Added test case for icon containing TOC_ + IC10 resources + fixed PNG reading and skipping of unknown resources.

Added test case for icon with no 8 bit mask + fixed fallback to 1 bit mask.
Added test case for icon with no mask + fixed transparency issue.
This commit is contained in:
Harald Kuhr
2011-11-14 15:25:21 +01:00
parent 3a9ad582f2
commit 9742af9a5d
7 changed files with 286 additions and 107 deletions
@@ -50,10 +50,10 @@ public class ICNSImageReaderTest extends ImageReaderAbstractTestCase {
new TestData(
getClassLoaderResource("/icns/GenericJavaApp.icns"),
new Dimension(16, 16), // 1 bit + 1 bit mask
new Dimension(16, 16), new Dimension(16, 16), // 8 bit CMAP, 32 bit
new Dimension(16, 16), new Dimension(16, 16), // 8 bit CMAP, 24 bit + 8 bit mask
new Dimension(32, 32), // 1 bit + 1 bit mask
new Dimension(32, 32), new Dimension(32, 32), // 8 bit CMAP, 32 bit
new Dimension(128, 128) // 32 bit
new Dimension(32, 32), new Dimension(32, 32), // 8 bit CMAP, 24 bit + 8 bit mask
new Dimension(128, 128) // 24 bit + 8 bit mask
),
new TestData(
getClassLoaderResource("/icns/Apple Retro.icns"),
@@ -61,16 +61,40 @@ 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, not readable without JAI or other JPEG 2000 support
// new Dimension(512, 512) // JPEG 2000
//, new Dimension(256, 256), // JPEG 2000 ic08, not readable without JAI or other JPEG 2000 support
// new Dimension(512, 512) // JPEG 2000 ic09
),
new TestData(
getClassLoaderResource("/icns/7zIcon.icns"), // Contains the icnV resource, that isn't an icon
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
// new Dimension(512, 512) // JPEG 2000
//, 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
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), // PNG ic08
new Dimension(512, 512), // PNG ic09
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
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
new Dimension(32, 32), new Dimension(32, 32), // 4 bit CMAP, 8 bit CMAP (no 8 bit mask)
new Dimension(128, 128) // 24 bit + 8 bit mask
),
new TestData(
getClassLoaderResource("/icns/XMLExport.icns"), // No masks at all, uncompressed 32 bit data
new Dimension(128, 128), // 32 bit interleaved
new Dimension(48, 48), // 32 bit interleaved
new Dimension(32, 32), // 32 bit interleaved
new Dimension(16, 16) // 32 bit interleaved
)
);
}
@@ -0,0 +1,5 @@
The icon files in this folder may contain copyrighted artwork. However, I believe that using them for test purposes
(without actually displaying the artwork) must be considered fair use.
If you disagree for any reason, please send me a note, and I will remove your icon from the distribution.
-- harald.kuhr@gmail.com