Rewrote handling of JPEG 2000 icons. Now returns blank image with correct dimensions + issues warning if can't be read, instead of exception.

Added quick fix conversion/reading for OS X using sips command line.
Updated test cases.
This commit is contained in:
Harald Kuhr
2011-11-28 12:02:00 +01:00
parent 905a3da97b
commit c006f22ac2
4 changed files with 216 additions and 16 deletions
@@ -61,19 +61,19 @@ public class ICNSImageReaderTest extends ImageReaderAbstractTestCase {
new Dimension(32, 32), // 24 bit + 8 bit mask
new Dimension(48, 48), // 24 bit + 8 bit mask
new Dimension(128, 128) // 24 bit + 8 bit mask
//, new Dimension(256, 256), // JPEG 2000 ic08, not readable without JAI or other JPEG 2000 support
// new Dimension(512, 512) // JPEG 2000 ic09
, new Dimension(256, 256), // JPEG 2000 ic08
new Dimension(512, 512) // JPEG 2000 ic09
),
new TestData(
getClassLoaderResource("/icns/7zIcon.icns"), // Contains the icnV resource, that isn't an icon
new Dimension(16, 16), // 24 bit + 8 bit mask
new Dimension(32, 32), // 24 bit + 8 bit mask
new Dimension(128, 128) // 24 bit + 8 bit mask
//, new Dimension(256, 256), // JPEG 2000 ic08
// new Dimension(512, 512) // JPEG 2000 ic09
, new Dimension(256, 256), // JPEG 2000 ic08
new Dimension(512, 512) // JPEG 2000 ic09
),
new TestData(
getClassLoaderResource("/icns/appStore.icns"), // Contains the 'TOC ' and icnV resources
getClassLoaderResource("/icns/appStore.icns"), // Contains the 'TOC ' and icnV resources + PNGs in ic08-10
new Dimension(16, 16), // 24 bit + 8 bit mask
new Dimension(32, 32), // 24 bit + 8 bit mask
new Dimension(128, 128), // 24 bit + 8 bit mask
@@ -82,7 +82,7 @@ public class ICNSImageReaderTest extends ImageReaderAbstractTestCase {
new Dimension(1024, 1024) // PNG ic10
),
new TestData(
getClassLoaderResource("/icns/XLW.icns"), // No 8 bit mask for 16x16 & 32x32, test fall back to 1 bit mask
getClassLoaderResource("/icns/XLW.icns"), // No 8 bit mask for 16x16 & 32x32, fall back to 1 bit mask
new Dimension(16, 16), // 1 bit + 1 bit mask
new Dimension(16, 16), new Dimension(16, 16), // 4 bit CMAP, 8 bit CMAP (no 8 bit mask)
new Dimension(32, 32), // 1 bit + 1 bit mask