]> git.imager.perl.org - imager.git/commitdiff
More debugging for auto probing of image types.
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Tue, 20 Aug 2002 01:32:11 +0000 (01:32 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Tue, 20 Aug 2002 01:32:11 +0000 (01:32 +0000)
image.c
t/t50basicoo.t

diff --git a/image.c b/image.c
index 244f128902da15e41beb5d76152b2055a1a322b1..9448faf0e1c1b6c119f728fe07a8a8ebb45312b6 100644 (file)
--- a/image.c
+++ b/image.c
@@ -2189,7 +2189,15 @@ i_test_format_probe(io_glue *data, int length) {
     }
   }
 
-
+       if (match && !strcmp(match, "jpeg")) {
+               unsigned int x0, x1;
+       rc = data->readcb(data, head, 18);
+         if (rc == -1) return NULL;
+               x0 = (unsigned char)head[0];
+               x1 = (unsigned char)head[1];
+         data->seekcb(data, -rc, SEEK_CUR);
+               printf("Jpeg reread: %x %x\n", x0, x1);
+       }
 
   if (!match && 
       (rc == 18) &&
index 6de70b76dcd1eff7d9628bb806904f93a682faff..59cf844b1104aef9d053625888e17d49c08febb4 100644 (file)
@@ -73,6 +73,7 @@ for my $type (@types) {
   if (ok($fh, "opening $opts{file}")) {
     binmode $fh;
     my $fhimg = Imager->new;
+    Imager::log_entry("Reading file: $opts{file}\n", -1);
     my $fhrc = $fhimg->read(fh=>$fh, %mopts);
     if (ok(!$fhrc, "check that type is required")) {
       ok ($fhimg->errstr =~ /type parameter missing/, "check for no type error");