Class ThumbnailInfo
java.lang.Object
com.atlassian.confluence.pages.thumbnail.ThumbnailInfo
Responsible for setting the height and width of thumbnails appropriately and generating the HTML
for rendering them in a page.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
default thumbnail max height and max width -
Constructor Summary
ConstructorDescriptionThumbnailInfo
(ImageDetails imageDetails, ImageDimensions maxDimensions, String attachmentsPath) Creates a thumbnail info for the given image details and maximum dimensions.ThumbnailInfo
(ImageDetails imageDetails, Dimensions maxDimensions, String attachmentsPath) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createThumbnailUrlPathFromAttachmentUrl
(String attachmentUrl) Returns the MIME type of the thumbnail if it is an intelligible image, ornull
otherwise.int
Get the height of the attachment before thumbnailingint
Get the width of the attachment before thumbnailinggetPopupLink
(String imageParameters) Get some HTML that will cause a thumbnail to be rendered inline, with a popup-link to the full-sized image.This method generates an a tag with the 'confluence-thumbnail-link' class.int
Get the height of the thumbnail image.getThumbnailImageHtml
(String imageParameters) Get the URL path for downloading the thumbnail, relative to the application's context-rootint
Get the width of the thumbnail image.static boolean
-
Field Details
-
THUMBNAIL_DEFAULT_WIDTH
public static final int THUMBNAIL_DEFAULT_WIDTHdefault thumbnail max height and max width- See Also:
-
-
Constructor Details
-
ThumbnailInfo
@Deprecated public ThumbnailInfo(ImageDetails imageDetails, Dimensions maxDimensions, String attachmentsPath) Deprecated.Creates a thumbnail info for the given image details and maximum dimensions. The attachmentPath is used to generate a thumbnail URL.- Throws:
IllegalArgumentException
- if imageDetails or its attachment isnull
- Since:
- 3.1
-
ThumbnailInfo
public ThumbnailInfo(ImageDetails imageDetails, ImageDimensions maxDimensions, String attachmentsPath) Creates a thumbnail info for the given image details and maximum dimensions. The attachmentPath is used to generate a thumbnail URL.- Throws:
IllegalArgumentException
- if imageDetails or its attachment isnull
- Since:
- 7.20
-
-
Method Details
-
systemSupportsThumbnailing
public static boolean systemSupportsThumbnailing() -
getOriginalWidth
public int getOriginalWidth()Get the width of the attachment before thumbnailing- Returns:
- the width in pixels of the attachment before thumbnailing, or -1 if the attachment is not an image which is thumbnailable
-
getOriginalHeight
public int getOriginalHeight()Get the height of the attachment before thumbnailing- Returns:
- the width in pixels of the attachment before thumbnailing, or -1 if the attachment is not an image which is thumbnailable
-
getThumbnailWidth
public int getThumbnailWidth()Get the width of the thumbnail image. This should never be greater than the configured maximum thumbnail width.- Returns:
- the width of the thumbnail image in pixels
-
getThumbnailHeight
public int getThumbnailHeight()Get the height of the thumbnail image. This should never be greater than the configured maximum thumbnail height.- Returns:
- the height of the thumbnail image in pixels
-
getThumbnailUrlPath
Get the URL path for downloading the thumbnail, relative to the application's context-root- Returns:
- the path for downloading the thumbnail, relative to the application's context-root;
-
createThumbnailUrlPathFromAttachmentUrl
-
getPopupLink
Get some HTML that will cause a thumbnail to be rendered inline, with a popup-link to the full-sized image. You can optionally supply some additional parameters to include in the img tag.This method generates an a tag with the 'confluence-thumbnail-link' class. The 'image-effects.js' file will attach an onclick function during the page initialisation.
- Parameters:
imageParameters
- a string of parameters suitable for inserting into an HTML img tag. Ignored if null.- Returns:
- the appropriate popup image HTML
-
getPopupLinkPrefix
This method generates an a tag with the 'confluence-thumbnail-link' class. The 'image-effects.js' file will attach an onclick function during the page initialisation.- Returns:
- the popup prefix html
- See Also:
-
getPopupLinkSuffix
-
getThumbnailImageHtml
-
getAttachment
-
getImageMimeType
Returns the MIME type of the thumbnail if it is an intelligible image, ornull
otherwise.
-
ThumbnailInfo(com.atlassian.confluence.pages.attachments.ImageDetails,com.atlassian.confluence.content.render.image.ImageDimensions,java.lang.String)
instead