public class ThumbnailRenderer extends Object
Constructor and Description |
---|
ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber,
com.google.common.base.Predicate<Dimensions> treshold)
Deprecated.
since 7.0.1 , use
ThumbnailRenderer(Thumber, Predicate) |
ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber,
Predicate<ImageDimensions> rasterBasedRenderingThreshold) |
Modifier and Type | Method and Description |
---|---|
com.atlassian.core.util.thumbnail.Thumbnail |
createThumbnail(File inputFile,
File outputFile,
int maxWidth,
int maxHeight)
Create a
Thumbnail from the input file. |
com.atlassian.core.util.thumbnail.Thumbnail |
createThumbnail(InputStream inputStream,
File outputFile,
int maxWidth,
int maxHeight)
Create a
Thumbnail from the input stream. |
static ImageDimensions |
dimensions(File inputFile) |
static ImageDimensions |
dimensions(InputStream inputStream) |
static Dimensions |
imageDimensions(File inputFile)
Deprecated.
since 7.0.1 , use
dimensions(File) |
static Dimensions |
imageDimensions(InputStream inputStream)
Deprecated.
since 7.0.1 , use
dimensions(InputStream) |
static <T> T |
withStreamConsumer(InputStream inputStream,
InputStreamConsumer<T> sc)
Call the
InputStreamConsumer with input stream ensuring that the input stream gets closed properly
afterwards. |
@Deprecated public ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, com.google.common.base.Predicate<Dimensions> treshold)
ThumbnailRenderer(Thumber, Predicate)
public ThumbnailRenderer(com.atlassian.core.util.thumbnail.Thumber thumber, Predicate<ImageDimensions> rasterBasedRenderingThreshold)
public com.atlassian.core.util.thumbnail.Thumbnail createThumbnail(File inputFile, File outputFile, int maxWidth, int maxHeight)
Thumbnail
from the input file. Thumbnails will always be PNG thumbnails!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
imagemaxWidth
xmaxHeight
, never returns nullThumbnailRenderException
- if the thumbnail cannot be created.public com.atlassian.core.util.thumbnail.Thumbnail createThumbnail(InputStream inputStream, File outputFile, int maxWidth, int maxHeight)
Thumbnail
from the input stream. Thumbnails will always be PNG thumbnails!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
imagemaxWidth
xmaxHeight
, never returns nullThumbnailRenderException
- if the thumbnail cannot be created.@Deprecated public static Dimensions imageDimensions(File inputFile)
dimensions(File)
public static ImageDimensions dimensions(File inputFile)
@Deprecated public static Dimensions imageDimensions(InputStream inputStream)
dimensions(InputStream)
public static ImageDimensions dimensions(InputStream inputStream)
public static <T> T withStreamConsumer(InputStream inputStream, InputStreamConsumer<T> sc)
InputStreamConsumer
with input stream ensuring that the input stream gets closed properly
afterwards.inputStream
- The stream containing the image datasc
- The InputStreamConsumer that consumes the file data InputStream
Copyright © 2003–2020 Atlassian. All rights reserved.