]> git.imager.perl.org - imager.git/commitdiff
i_test_format_probe:
authorTony Cook <tony@develop=help.com>
Mon, 22 May 2006 03:18:27 +0000 (03:18 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 22 May 2006 03:18:27 +0000 (03:18 +0000)
 - added Utah RLE,
 - separated ICO and CUR file formats,
 - fix duplicate PCX entry

image.c
t/t1000files.t

diff --git a/image.c b/image.c
index f1d659d859502fbd3e8371944ad7c68f301039f1..9c709415387b0086f494ad3795329dc306134fa4 100644 (file)
--- a/image.c
+++ b/image.c
@@ -2190,7 +2190,7 @@ i_test_format_probe(io_glue *data, int length) {
        http://www.fileformat.info/format/pcx/
     */
     FORMAT_ENTRY("\x0A\x00\x01", "pcx"),
-    FORMAT_ENTRY("\x0A\x03\x01", "pcx"),
+    FORMAT_ENTRY("\x0A\x02\x01", "pcx"),
     FORMAT_ENTRY("\x0A\x03\x01", "pcx"),
     FORMAT_ENTRY("\x0A\x04\x01", "pcx"),
     FORMAT_ENTRY("\x0A\x05\x01", "pcx"),
@@ -2204,10 +2204,15 @@ i_test_format_probe(io_glue *data, int length) {
     /* EPS - Encapsulated Postscript */
     /* only reading 18 chars, so we don't include the F in EPSF */
     FORMAT_ENTRY("%!PS-Adobe-2.0 EPS", "eps"),
+
+    /* Utah RLE */
+    FORMAT_ENTRY("\x52\xCC", "utah"),
   };
   static const struct magic_entry more_formats[] = {
-    FORMAT_ENTRY("\x00\x00\x01\x00", "ico"),
-    FORMAT_ENTRY("\x00\x00\x02\x00", "ico"), /* cursor */
+    /* these were originally both listed as ico, but cur files can
+       include hotspot information */
+    FORMAT_ENTRY("\x00\x00\x01\x00", "ico"), /* Windows icon */
+    FORMAT_ENTRY("\x00\x00\x02\x00", "cur"), /* Windows cursor */
   };
 
   unsigned int i;
index b77969ad402e9f22633676ca3f91db149419bd73..634721c2d6bdc68cffbb03e2006b249407c2865a 100644 (file)
@@ -5,7 +5,7 @@
 
 use strict;
 use lib 't';
-use Test::More tests => 27;
+use Test::More tests => 29;
 use Imager;
 
 Imager::init_log("testout/t1000files.log", 1);
@@ -86,6 +86,12 @@ probe_ok(<<ICO, "ico", "Windows Icon");
 00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00
 ICO
 
+probe_ok(<<ICO, "cur", "Windows Cursor");
+00 00 02 00 02 00 20 20 10 00 00 00 00 00 E8 02
+00 00 26 00 00 00 20 20 00 00 00 00 00 00 A8 08
+00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00
+ICO
+
 probe_ok(<<RGB, "rgb", "SGI RGB");
 01 DA 01 01 00 03 00 96 00 96 00 03 00 00 00 00 
 00 00 00 FF 00 00 00 00 6E 6F 20 6E 61 6D 65 00
@@ -128,6 +134,13 @@ probe_ok(<<EPS, "eps", "Encapsulated Postscript");
 72 3A 20 70 6E 6D 74 6F 70 73 0A 25 25 54 69 74
 EPS
 
+probe_ok(<<UTAH, "utah", "Utah RLE");
+52 CC 00 00 00 00 0A 00 0A 00 0A 03 08 00 08 00 
+2F 00 48 49 53 54 4F 52 59 3D 70 6E 6D 74 6F 72 
+6C 65 20 6F 6E 20 54 68 75 20 4D 61 79 20 31 31 
+20 31 36 3A 33 35 3A 34 33 20 32 30 30 36 0A 09 
+UTAH
+
 sub probe_ok {
   my ($packed, $exp_type, $name) = @_;