From: Tony Cook Date: Fri, 1 Oct 2010 05:27:53 +0000 (+0000) Subject: detect some more file types X-Git-Tag: Imager-0.79~34 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/bca6a3d574e1b66d373e41fd6aca13df1a8a776d detect some more file types --- diff --git a/image.c b/image.c index db4e0376..28721a20 100644 --- a/image.c +++ b/image.c @@ -2267,6 +2267,14 @@ i_test_format_probe(io_glue *data, int length) { /* bzip2 compressed */ FORMAT_ENTRY("BZh", "bzip2"), + + /* WEBP + http://code.google.com/speed/webp/docs/riff_container.html */ + FORMAT_ENTRY2("RIFF WEBP", "webp", "xxxx xxxx"), + + /* JPEG 2000 + This might match a little loosely */ + FORMAT_ENTRY("\x00\x00\x00\x0CjP \x0D\x0A\x87\x0A", "jp2"), }; static const struct magic_entry more_formats[] = { /* these were originally both listed as ico, but cur files can diff --git a/t/t1000files.t b/t/t1000files.t index 66d3a98d..00380a02 100644 --- a/t/t1000files.t +++ b/t/t1000files.t @@ -4,7 +4,7 @@ # the file format use strict; -use Test::More tests => 33; +use Test::More tests => 35; use Imager; Imager::init_log("testout/t1000files.log", 1); @@ -167,6 +167,23 @@ FF DF EE C8 0F FF F3 FF FF FF FC FF FB B1 FF FB F4 07 DF D0 03 B8 03 60 31 82 05 2A 6A 06 83 20 BZIP2 +probe_ok(<