]> git.imager.perl.org - imager.git/commitdiff
add a magic entry to detect XWD files
authorTony Cook <tony@develop=help.com>
Fri, 21 Jul 2006 00:01:57 +0000 (00:01 +0000)
committerTony Cook <tony@develop=help.com>
Fri, 21 Jul 2006 00:01:57 +0000 (00:01 +0000)
image.c
t/t1000files.t

diff --git a/image.c b/image.c
index 41a86724614bbc73d25624cc82d97d4bbc2411e8..04b287d90b563a702fe9fece48efe44b67f169b7 100644 (file)
--- a/image.c
+++ b/image.c
@@ -2211,6 +2211,8 @@ i_test_format_probe(io_glue *data, int length) {
        include hotspot information */
     FORMAT_ENTRY("\x00\x00\x01\x00", "ico"), /* Windows icon */
     FORMAT_ENTRY("\x00\x00\x02\x00", "cur"), /* Windows cursor */
+    FORMAT_ENTRY2("\x00\x00\x00\x00\x00\x00\x00\x07", 
+                 "xwd", "    xxxx"), /* X Windows Dump */
   };
 
   unsigned int i;
index 634721c2d6bdc68cffbb03e2006b249407c2865a..da96ece76cd1e7fde650796536b89cce4ee22013 100644 (file)
@@ -5,7 +5,7 @@
 
 use strict;
 use lib 't';
-use Test::More tests => 29;
+use Test::More tests => 30;
 use Imager;
 
 Imager::init_log("testout/t1000files.log", 1);
@@ -141,6 +141,13 @@ probe_ok(<<UTAH, "utah", "Utah RLE");
 20 31 36 3A 33 35 3A 34 33 20 32 30 30 36 0A 09 
 UTAH
 
+probe_ok(<<XWD, "xwd", "X Window Dump");
+00 00 00 69 00 00 00 07 00 00 00 02 00 00 00 18
+00 00 01 E4 00 00 01 3C 00 00 00 00 00 00 00 00
+00 00 00 20 00 00 00 00 00 00 00 20 00 00 00 20
+00 00 07 90 00 00 00 04 00 FF 00 00 00 00 FF 00
+XWD
+
 sub probe_ok {
   my ($packed, $exp_type, $name) = @_;