From 27c373c9ef1e2c517b5ba1cf8ce99cfe99a101a6 Mon Sep 17 00:00:00 2001 From: Arnar Mar Hrafnkelsson Date: Tue, 20 Aug 2002 01:32:11 +0000 Subject: [PATCH] More debugging for auto probing of image types. --- image.c | 10 +++++++++- t/t50basicoo.t | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/image.c b/image.c index 244f1289..9448faf0 100644 --- 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) && diff --git a/t/t50basicoo.t b/t/t50basicoo.t index 6de70b76..59cf844b 100644 --- a/t/t50basicoo.t +++ b/t/t50basicoo.t @@ -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"); -- 2.30.2