public class DelegatingThumbnailRenderer extends Object
Images will be resized using a high quality renderer if possible and a streaming renderer if they exceed a certain width or height.
Constructor and Description |
---|
DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber,
AttachmentManager attachmentManager)
Create a DelegatingThumbnailRenderer using an adaptive strategy that take the available memory into account to decide if
we use the higher quality rendering or the lower quality stream based rendering (less memory consumption).
|
DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber,
AttachmentManager attachmentManager,
int rasterSizeThresholdPx)
Create a DelegatingThumbnailRenderer that will use the lower quality stream based rendering if the image exceeds
the
rasterSizeThresholdPx (height or width in px). |
DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber,
AttachmentManager attachmentManager,
com.google.common.base.Predicate<Dimensions> rasterBasedRenderingThreshold)
Create a DelegatingThumbnailRenderer that will use the
rasterBasedRenderingThreshold Predicate to decide
if it's going to use the stream based (lower quality but low memory consumption) or the
raster based renderer (higher quality but high memory consumption). |
Modifier and Type | Method and Description |
---|---|
com.atlassian.core.util.thumbnail.Thumbnail |
retrieveOrCreateThumbNail(Attachment attachment,
File thumbnailFile,
int maxWidth,
int maxHeight)
Create a new or return an existing
Thumbnail for this attachment. |
com.atlassian.core.util.thumbnail.Thumbnail |
retrieveOrCreateThumbNail(Attachment attachment,
File thumbnailFile,
String ignoredImageType,
int maxWidth,
int ignoredMinWidth,
int height)
Deprecated.
|
public DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, AttachmentManager attachmentManager)
public DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, AttachmentManager attachmentManager, int rasterSizeThresholdPx)
rasterSizeThresholdPx
(height or width in px).public DelegatingThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, AttachmentManager attachmentManager, com.google.common.base.Predicate<Dimensions> rasterBasedRenderingThreshold)
rasterBasedRenderingThreshold
Predicate to decide
if it's going to use the stream based (lower quality but low memory consumption) or the
raster based renderer (higher quality but high memory consumption).thumber
- Thumber instance to useattachmentManager
- The attachment manager that will be used to retrieve the image datarasterBasedRenderingThreshold
- PredicatePredicate.apply(T)
method should return true for the given Dimensions
if the raster
based (memory intensive) rendering approach can be used.@Deprecated public com.atlassian.core.util.thumbnail.Thumbnail retrieveOrCreateThumbNail(Attachment attachment, File thumbnailFile, String ignoredImageType, int maxWidth, int ignoredMinWidth, int height)
retrieveOrCreateThumbNail(com.atlassian.confluence.pages.Attachment, java.io.File, int, int)
public com.atlassian.core.util.thumbnail.Thumbnail retrieveOrCreateThumbNail(@Nonnull Attachment attachment, File thumbnailFile, int maxWidth, int maxHeight) throws ThumbnailRenderException
Thumbnail
for this attachment. Thumbnails will always be PNG thumbnails!attachment
- - The attachment that contains the image data. Cannot be null.thumbnailFile
- - The thumbnail file that will be used to store the rendered thumbnailmaxWidth
- - The maximum width of the thumbnail - this renderer maintains the aspect ratio of the original imagemaxHeight
- - The maximum height of the thumbnail - this renderer maintains the aspect ratio of the original imagemaxWidth
xmaxHeight
, never returns nullThumbnailRenderException
- if the thumbnail cannot be created.Copyright © 2003–2016 Atlassian. All rights reserved.