@Override public String getMimeType() { return thumbnail.getMimeType().name(); }
private AvatarImageDataProviderImpl(final InputStream uploadedImage, final Selection cropping) throws IOException { // rather should accept image? this.uploadedImage = thumber.getImage(uploadedImage); this.cropping = cropping; }
@Override public int getHeight() { return thumbnail.getHeight(); }
private Thumbnail createThumbnail(InputStream originalFile, File thumbnailFile, int maxWidth, int maxHeight, long thumbId, String fileName) throws IOException, FileNotFoundException { // Load original image. Image originalImage = getImage(originalFile); // Create scaled buffered image from original image. BufferedImage scaledImage = scaleImage(originalImage, maxWidth, maxHeight); int height = scaledImage.getHeight(); int width = scaledImage.getWidth(); storeImage(scaledImage, thumbnailFile); return new Thumbnail(height, width, fileName, thumbId); }
private Thumbnail createThumbnail(InputStream inputStream, File thumbnailFile, int maxWidth, int maxHeight, long thumbId, String fileName) throws IOException, ThumbnailRenderException { final BufferedImage thumbnailImage = scaleImage(maxWidth, maxHeight, inputStream); final int height = thumbnailImage.getHeight(); final int width = thumbnailImage.getWidth(); storeImage(thumbnailImage, thumbnailFile); return new Thumbnail(height, width, fileName, thumbId, mimeType); }
private BufferedImage scaleImage(Image originalImage, int maxWidth, int maxHeight) { return scaleImage(originalImage, determineScaleSize(maxWidth, maxHeight, originalImage)); }
public BufferedImage scaleImage(int maxWidth, int maxHeight, InputStream imageStream) throws IOException { final ImageInputStream imageInputStream = ThumbnailUtil.getImageInputStream(imageStream); try { return scaleImage(maxWidth, maxHeight, imageInputStream); } finally { imageInputStream.close(); } }
@Override public int getWidth() { return thumbnail.getWidth(); }
@Override public String getFilename() { return thumbnail.getFilename(); }
@Override public long getAttachmentId() { return thumbnail.getAttachmentId(); }
public CroppingAvatarImageDataProviderFactoryImpl(final AvatarTagger avatarTagger, final ImageScaler scaler) { this.scaler = scaler; thumber = new Thumber(); this.avatarTagger = avatarTagger; this.targetFormat = "png"; }
/** * Returns the hash code for this <code>Thumbnail</code>. * * @return the hash code for this <code>Thumbnail</code> */ @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); result = 31 * result + (filename != null ? filename.hashCode() : 0); result = 31 * result + (int) (attachmentId ^ (attachmentId >>> 32)); return result; }
/** * Notification of the properties of the image to use. Not used in this implementation. * * @param props The map of properties for this image */ public void setProperties(Hashtable props) { createImage(); }
public ThumbnailDimension determineScaleSize(int maxWidth, int maxHeight, int imageWidth, int imageHeight) { return ThumbnailUtil.determineScaledDimensions(maxWidth, maxHeight, imageWidth, imageHeight); }
@Override public int hashCode() { int result = attachment.hashCode(); result = 31 * result + (thumbnail != null ? thumbnail.hashCode() : 0); return result; }
public ImageFileOperations() { this.thumber = new Thumber(); }
/** * Notification of the dimensions of the source image. * * @param w The width of the source image * @param h The height of the source image */ public void setDimensions(int w, int h) { width = w; height = h; createImage(); }
public AvatarPickerHelperImpl(AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, UserUtil userUtil, final UniversalAvatarsService universalAvatarsService) { this.avatarManager = avatarManager; this.authenticationContext = authenticationContext; this.applicationProperties = properties; this.requestContextFactory = requestContextFactory; this.userUtil = userUtil; this.universalAvatarsService = universalAvatarsService; this.thumber = new Thumber(Thumbnail.MimeType.PNG); }
public void setColorModel(ColorModel model) { colorModel = model; createImage(); }