Class ThumbnailRenderer
java.lang.Object
com.atlassian.confluence.impl.pages.thumbnail.renderer.ThumbnailRenderer
-
Constructor Summary
ConstructorsConstructorDescriptionThumbnailRenderer
(com.atlassian.core.util.thumbnail.Thumber thumber, com.google.common.base.Predicate<Dimensions> treshold) Deprecated.ThumbnailRenderer
(com.atlassian.core.util.thumbnail.Thumber thumber, Predicate<ImageDimensions> rasterBasedRenderingThreshold) -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.core.util.thumbnail.Thumbnail
createThumbnail
(File inputFile, File outputFile, int maxWidth, int maxHeight) Create aThumbnail
from the input file.com.atlassian.core.util.thumbnail.Thumbnail
createThumbnail
(InputStream inputStream, File outputFile, int maxWidth, int maxHeight) Create aThumbnail
from the input stream.static ImageDimensions
dimensions
(File inputFile) static ImageDimensions
dimensions
(InputStream inputStream) static Dimensions
imageDimensions
(File inputFile) Deprecated.since 7.0.1 , usedimensions(File)
static Dimensions
imageDimensions
(InputStream inputStream) Deprecated.since 7.0.1 , usedimensions(InputStream)
static <T> T
withStreamConsumer
(InputStream inputStream, InputStreamConsumer<T> sc) Call theInputStreamConsumer
with input stream ensuring that the input stream gets closed properly afterwards.
-
Constructor Details
-
ThumbnailRenderer
@Deprecated public ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, com.google.common.base.Predicate<Dimensions> treshold) Deprecated.since 7.0.1 , useThumbnailRenderer(Thumber, Predicate)
-
ThumbnailRenderer
public ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, Predicate<ImageDimensions> rasterBasedRenderingThreshold) - Since:
- 7.0.1
-
-
Method Details
-
createThumbnail
public com.atlassian.core.util.thumbnail.Thumbnail createThumbnail(File inputFile, File outputFile, int maxWidth, int maxHeight) Create aThumbnail
from the input file. Thumbnails will always be PNG thumbnails!- Parameters:
inputFile
- - The attachment that contains the image dataoutputFile
- - 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 image- Returns:
- Thumbnail that is at most
maxWidth
xmaxHeight
, never returns null - Throws:
ThumbnailRenderException
- if the thumbnail cannot be created.
-
createThumbnail
public com.atlassian.core.util.thumbnail.Thumbnail createThumbnail(InputStream inputStream, File outputFile, int maxWidth, int maxHeight) Create aThumbnail
from the input stream. Thumbnails will always be PNG thumbnails!- Parameters:
inputStream
- - The stream that contains the image dataoutputFile
- - 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 image- Returns:
- Thumbnail that is at most
maxWidth
xmaxHeight
, never returns null - Throws:
ThumbnailRenderException
- if the thumbnail cannot be created.
-
imageDimensions
Deprecated.since 7.0.1 , usedimensions(File)
-
dimensions
- Since:
- 7.0.1
-
imageDimensions
Deprecated.since 7.0.1 , usedimensions(InputStream)
-
dimensions
- Since:
- 7.0.1
-
withStreamConsumer
Call theInputStreamConsumer
with input stream ensuring that the input stream gets closed properly afterwards.- Parameters:
inputStream
- The stream containing the image datasc
- The InputStreamConsumer that consumes the file dataInputStream
-
ThumbnailRenderer(Thumber, Predicate)