xinxinlx / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

cannot opj_decompress file compressed with opj_compress #310

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
opj_compress -i img.png -o img.jp2
    [INFO] tile number 1 / 1
    Generated outfile img.jp2

opj_decompress -i img.jp2 -o img.bmp
    !! Unrecognized format for infile: img.jp2 [accept only *.j2k, *.jp2, *.jpc or *.jpt] !!

I have compiled openjpeg-2.0.0 from sources on linux 2.6.24 debian 4.0

The img.jp2 header is this :
00 00 00 0C 6A 50 20 20 FF 4F FF 51 00 2F 00 00 

I understand it should be
JP2_RFC3745_MAGIC  00 00 00 0c 6a 50 20 20 0d 0a 87 0a 
or      JP2_MAGIC  0d 0a 87 0a 

Original issue reported on code.google.com by cutanet....@gmail.com on 24 Mar 2014 at 3:49

Attachments:

GoogleCodeExporter commented 9 years ago
Hum, neat example indeed:

$ valgrind ./bin/opj_compress -i img.png -o img.jp2
==9652== Memcheck, a memory error detector
==9652== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==9652== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==9652== Command: ./bin/opj_compress -i /home/mathieu/Téléchargements/img.png 
-o img.jp2
==9652== 

==9652== Invalid read of size 8
==9652==    at 0x413B94: pngtoimage (convert.c:3343)
==9652==    by 0x406DFA: main (opj_compress.c:1596)
==9652==  Address 0x657b770 is 16 bytes before a block of size 2,211,840 alloc'd
==9652==    at 0x4C281F0: calloc (vg_replace_malloc.c:618)
==9652==    by 0x4E3FA01: opj_image_create (image.c:61)
==9652==    by 0x413A7E: pngtoimage (convert.c:3331)
==9652==    by 0x406DFA: main (opj_compress.c:1596)
==9652== 

Original comment by mathieu.malaterre on 25 Mar 2014 at 9:47

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 25 Mar 2014 at 9:47

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2789.

Original comment by mathieu.malaterre on 25 Mar 2014 at 11:47