Class ThumbnailTag
- All Implemented Interfaces:
JcmsConstants,JaliosConstants,Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)
which use same internal cache.- Since:
- jcms-5.5.0
- Author:
- Olivier Jaquemet
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImageFormatstatic final Stringstatic final Stringstatic final intstatic final intstatic final Stringstatic final intFields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, TYPES_UNKNOWN_CLASS_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XMLFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilebuildThumbnail(File srcFile, int width, int height, File defaultFile, String background) Returns a Thumbnail for the given path.static StringbuildThumbnail(String path, int width, int height, String defaultPath) static StringbuildThumbnail(String path, int width, int height, String defaultPath, String background) Returns a Thumbnail for the given path.protected voidclean()static booleancreateImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight) static booleancreateImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background) This method creates a thumbnail of the given image source file.static booleancreateImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given image source file.static booleancreateOpenOfficeThumbnail(File docFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given Open Office file.static booleancreateOpenXmlThumbnail(File docFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given OpenXml file.static FilecreateThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight) static FilecreateThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, String background) Create a thumbnail using the first valid source from FileDocument, File or URL using given dimensions.static FilecreateThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) Create a thumbnail using the first valid source from FileDocument, File or URL using given dimensions.static StringcreateThumbnailFromSessionAttribute(String sessionAttrName) static booleancreateThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile) static booleancreateThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile, String background) This method create a thumbnail of one of the three source given using the options passed as parameters ("now" as opposed to generation when going through ajax}.static booleancreateThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile, String background, boolean square) This method create a thumbnail of one of the three source given using the options passed as parameters ("now" as opposed to generation when going through ajax}.intintdoEndTag()intstatic ImageFormatgetDefaultImageFormat(FileDocument fileDoc, File srcFile, URL url) Retrieve the default format to use for the specified source if none was specifiedstatic FilegetThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.static FilegetThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight, boolean square) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.static FilegetThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight, boolean square, String extension) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.static voidinvalidateCacheAttemptThumbnail(FileDocument fileDoc, File srcFile, URL url) Invalidates the cache of failure while attempt to create a thumbnail for the given parameter.static booleanisSmallImage(long width, long height) static booleanisSmallImage(FileDocument fileDoc) voidsetAddChannelBaseUrl(boolean addChannelBaseUrl) voidsetAjaxLoadingImage(String ajaxLoadingImage) voidvoidsetBackground(String background) voidvoidvoidsetDataAttribute(DataAttribute dataAttribute) voidsetDestination(String path) voidvoidvoidsetForceUpdate(boolean forceUpdate) voidvoidsetHeight(int height) voidsetHtmlAttributes(String htmlAttributes) voidsetLazy(boolean lazy) voidvoidsetSquare(boolean square) voidvoidsetUseAjaxLoading(boolean useAjaxLoading) voidsetWidth(int width) Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Field Details
-
MAX_THUMB_SIZE
public static final int MAX_THUMB_SIZE- See Also:
-
MIN_THUMB_SIZE
public static final int MIN_THUMB_SIZE- See Also:
-
SMALL_IMAGE_SIZE
public static final int SMALL_IMAGE_SIZE- See Also:
-
DEFAULT_FORMAT
-
DEFAULT_FORMAT_PROPERTY
- See Also:
-
LAZY_LOADING_ENABLED_PROPERTY
- See Also:
-
SMALL_IMAGE_CSS_CLASS
- See Also:
-
-
Constructor Details
-
ThumbnailTag
public ThumbnailTag()
-
-
Method Details
-
clean
protected void clean() -
setData
-
setFileDoc
-
setFile
-
setPath
-
setUrl
-
setFormat
-
setWidth
public void setWidth(int width) -
setHeight
public void setHeight(int height) -
setDestination
-
setBackground
-
setSquare
public void setSquare(boolean square) -
setForceUpdate
public void setForceUpdate(boolean forceUpdate) -
setAlt
-
setCss
-
setHtmlAttributes
-
setUseAjaxLoading
public void setUseAjaxLoading(boolean useAjaxLoading) -
setAjaxLoadingImage
-
setAddChannelBaseUrl
public void setAddChannelBaseUrl(boolean addChannelBaseUrl) -
setDataAttribute
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
isSmallImage
-
isSmallImage
public static boolean isSmallImage(long width, long height) -
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspException- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doAfterBody
public int doAfterBody() throws javax.servlet.jsp.JspException- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
setLazy
public void setLazy(boolean lazy) -
createThumbnailFromSessionAttribute
- Parameters:
sessionAttrName- the name of session attribute Map object in which all options were stored- Returns:
- relative thumbnail path if the thumbnail was created, null otherwise
- Throws:
Exception- if option 'urlStr' (from option map) could not be converted to URL
-
invalidateCacheAttemptThumbnail
Invalidates the cache of failure while attempt to create a thumbnail for the given parameter. If not null, the key in the cache is for the FileDocument, otherwise, for the srcFile, otherwise for the file with given URL.- Parameters:
fileDoc- the FileDocument to invalidate cache thumbnail generation failuresrcFile- the file to invalidate the cacheurl- the URL of the file to invalidate the cache- Since:
- jcms-6.1.2
-
buildThumbnail
public static File buildThumbnail(File srcFile, int width, int height, File defaultFile, String background) Returns a Thumbnail for the given path. If thumbnail do not exists then create it.Warning : This method does not use any cache for failed attemps and may not meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)instead.- Parameters:
srcFile- the original filewidth- target max widthheight- target max widthdefaultFile- the default file to use if thumbnail do not existsbackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight- Returns:
- File the thumbnail file
-
buildThumbnail
- Parameters:
path- Relative path to the original filewidth- target max widthheight- target max widthdefaultPath- the default image to use if thumbnail do not exists- Returns:
- String relative path to the thumbnail
- See Also:
-
buildThumbnail
public static String buildThumbnail(String path, int width, int height, String defaultPath, String background) Returns a Thumbnail for the given path. If thumbnail do not exists then create it.Warning : This method does not use any cache for failed attemps and may not meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)instead.- Parameters:
path- Relative path to the original filewidth- target max widthheight- target max widthdefaultPath- the default image to use if thumbnail do not existsbackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight- Returns:
- String relative path to the thumbnail
-
createThumbnail
public static File createThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight) - Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to JPEG if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generate- Returns:
- the thumbnail file on success, or null if the thumbnail could not be created.
- See Also:
-
createThumbnail
public static File createThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, String background) Create a thumbnail using the first valid source from FileDocument, File or URL using given dimensions.For performance reason, if a previous thumbnail creation attempt failed for the specified source, this method will not perform any creation until the delay specified by property "tag.thumbnail.failed-attempt-check-delay" has been reached (or if site is restarted).
Be careful though that this method is not asynchronous and thus may take some time to process if thumbnail creation processing is long.- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to JPEG if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight- Returns:
- the thumbnail file on success, or null if the thumbnail could not be created.
- Since:
- jcms-6.1
-
createThumbnail
public static File createThumbnail(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) Create a thumbnail using the first valid source from FileDocument, File or URL using given dimensions.For performance reason, if a previous thumbnail creation attempt failed for the specified source, this method will not perform any creation until the delay specified by property "tag.thumbnail.failed-attempt-check-delay" has been reached (or if site is restarted).
Be careful though that this method is not asynchronous and thus may take some time to process if thumbnail creation processing is long.- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to the format specified in property "tag.thumbnail.format" if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare- set to true to crop image into a square using the specified width during thumbnail creation.- Returns:
- the thumbnail file on success, or null if the thumbnail could not be created.
- Since:
- jcms-9.0
-
getDefaultImageFormat
Retrieve the default format to use for the specified source if none was specified- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnail- Returns:
- an ImageFormat, never return null
-
getThumbnailFile
public static File getThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailmaxWidth- the maximum width of the thumbnail, a positive integer.maxHeight- the maximum height of the thumbnail, a positive integer.- Returns:
- a File representing the thumbnail filename or null if none could be computed.
- Since:
- jcms-6.1
-
getThumbnailFile
public static File getThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight, boolean square) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailmaxWidth- the maximum width of the thumbnail, a positive integer.maxHeight- the maximum height of the thumbnail, a positive integer.square- set to true to indicate image is cropped into a square- Returns:
- a File representing the thumbnail filename or null if none could be computed.
- Since:
- jcms-9.0
-
getThumbnailFile
public static File getThumbnailFile(FileDocument fileDoc, File srcFile, URL url, int maxWidth, int maxHeight, boolean square, String extension) Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailmaxWidth- the maximum width of the thumbnail, a positive integer.maxHeight- the maximum height of the thumbnail, a positive integer.square- set to true to indicate image is cropped into a squareextension- the extension of the thumbnail format being create/generated/manipulated. eg"jpg"
This value is not used when generating URL. See propertytag.thumbnail.thumbshot.file-ext.- Returns:
- a File representing the thumbnail filename or null if none could be computed.
- Since:
- jcms-10.0.1 JCMS-4762
-
createThumbnailNow
public static boolean createThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile) - Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to JPEG if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatedestFile- destination file (of the thumbnail to generate)- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-
createThumbnailNow
public static boolean createThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile, String background) This method create a thumbnail of one of the three source given using the options passed as parameters ("now" as opposed to generation when going through ajax}.Warning : This method does not use any cache for failed attemps and may not meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)instead. Possible sources are (only of must be passed, other must be null) :- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to JPEG if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatedestFile- destination file (of the thumbnail to generate)background- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-
createThumbnailNow
public static boolean createThumbnailNow(FileDocument fileDoc, File srcFile, URL url, ImageFormat format, int maxWidth, int maxHeight, File destFile, String background, boolean square) This method create a thumbnail of one of the three source given using the options passed as parameters ("now" as opposed to generation when going through ajax}.Warning : This method does not use any cache for failed attemps and may not meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)instead. Possible sources are (only of must be passed, other must be null) :- Parameters:
fileDoc- aFileDocumentof which to create thumbnailsrcFile- aFileof which to create thumbnailurl- anURLof which to create thumbnailformat- theImageFormatof the file to generate (default to JPEG if null)maxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatedestFile- destination file (of the thumbnail to generate)background- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare- set to true to crop image into a square using the specified width during thumbnail creation.- Returns:
- true on success, or false if the thumbnail could not be created
- Since:
- jcms-9.0
- See Also:
-
createImageThumbnail
public static boolean createImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight) - Parameters:
imageFile- image file of which to create a thumbnaildest- destination file (the thumbnail to generate)format- the format of the file to generate as requested by the ThumbnailTagmaxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generate- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-
createImageThumbnail
public static boolean createImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background) This method creates a thumbnail of the given image source file.- Parameters:
imageFile- image file of which to create a thumbnaildest- destination file (the thumbnail to generate)format- the format of the file to generate as requested by the ThumbnailTagmaxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-
createImageThumbnail
public static boolean createImageThumbnail(File imageFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given image source file.- Parameters:
imageFile- image file of which to create a thumbnaildest- destination file (the thumbnail to generate)format- the format of the file to generate as requested by the ThumbnailTagmaxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare- set to true to crop image into a square using the specified width during thumbnail creation.- Returns:
- true on success, or false if the thumbnail could not be created
- Since:
- jcms-9.0
- See Also:
-
createOpenOfficeThumbnail
public static boolean createOpenOfficeThumbnail(File docFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given Open Office file.- Parameters:
docFile- Open Office file of which to create a thumbnaildest- destination file (the thumbnail to generate)format- the format of the file to generate as requested by the ThumbnailTagmaxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare- set to true to crop image into a square using the specified width during thumbnail creation.- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-
createOpenXmlThumbnail
public static boolean createOpenXmlThumbnail(File docFile, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean square) This method creates a thumbnail of the given OpenXml file.- Parameters:
docFile- Open Office file of which to create a thumbnaildest- destination file (the thumbnail to generate)format- the format of the file to generate as requested by the ThumbnailTagmaxWidth- the maximum width of the thumbnail to generatemaxHeight- the maximum height of the thumbnail to generatebackground- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare- set to true to crop image into a square using the specified width during thumbnail creation.- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
-