From 89d4294d842e0402bba78641316b6b7ccee1ab36 Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Tue, 16 Apr 2019 11:43:38 -0500 Subject: [PATCH] Fix scale() trying to create a TYPE_CUSTOM BufferedImage in situations involving very small source or destination (usually TIFF) images (#282) --- CHANGES.md | 2 ++ .../edu/illinois/library/cantaloupe/processor/Java2DUtil.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f12ca2e7c..4e525efd6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,8 @@ is set to a relative path outside of the current working directory. * Fixed a regression in the handling of the `X-Forwarded-Path` header. * Fixed breakage in manual processor selection from the Control Panel. +* Fixed an error from Java2dProcessor when downscaling TIFF source images to a + very small size. * Fixed improper codestream access in KakaduNativeProcessor that could cause cause degraded output for certain images. * Improved resilience when reading certain oddly-encoded GIFs in diff --git a/src/main/java/edu/illinois/library/cantaloupe/processor/Java2DUtil.java b/src/main/java/edu/illinois/library/cantaloupe/processor/Java2DUtil.java index 194a2d063..ba6915f2b 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/processor/Java2DUtil.java +++ b/src/main/java/edu/illinois/library/cantaloupe/processor/Java2DUtil.java @@ -993,7 +993,7 @@ static BufferedImage scale(final BufferedImage inImage, scaledImage = new BufferedImage( targetSize.intWidth(), targetSize.intHeight(), - inImage.getType()); + BufferedImage.TYPE_INT_ARGB); } return scaledImage; }