xinxinlx / openjpeg

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

autotools + big endian config is broken #302

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CMakeLists.txt:
 WORDS_BIGENDIAN instead of OPJ_BIG_ENDIAN because
 OPJ_BIG_ENDIAN is nowhere used.

j2k_to_image.c:
 infile_format() reads the MAGIC of JPEG2000 files.

winfried

Original issue reported on code.google.com by szukw...@arcor.de on 17 Mar 2014 at 8:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 18 Mar 2014 at 7:58

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2761.

Original comment by mathieu.malaterre on 18 Mar 2014 at 2:37

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

Original comment by mathieu.malaterre on 18 Mar 2014 at 2:40

GoogleCodeExporter commented 9 years ago
No, it is NOT fixed.

PROBLEM 1, ENDIAN:
==================

configure.ac:
=============
AC_C_BIGENDIAN

opj_config.h.in:
==================
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
#  define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
#  undef WORDS_BIGENDIAN
# endif
#endif

PROBLEM 2: j2k_to_image() does not check JPEG200 file:
======================================================
GE PACS system Kakadu-generated JP2 throws error, Oct 31, 2011
 j2k_to_image.c.dif.gz
 j2k_to_image.c-II.dif.gz

This problem has been fixed in the trunk of v2; but never in
the branch of v1:
--------------------------------------------------------------------
./j2k_to_image -i pacs.eg.jp2 -o pacs.eg.png

[ERROR] Integer overflow in box->length
[ERROR] Failed to read boxhdr
[ERROR] Failed to decode jp2 structure
ERROR -> j2k_to_image: failed to decode image!

bin/opj_decompress  -i /home/IMG/JP2/pacs.eg.jp2 -o pacs.eg.jp2.png

===========================================
The extension of this file is incorrect.
FOUND .jp2. SHOULD BE .j2k or .jpc or .j2c
===========================================

[INFO] Start to read j2k main header (0).
[INFO] Main header has been correctly decoded.
[INFO] No decoded area parameters, set the decoded area to the whole image
[INFO] Header of tile 0 / 0 has been read.
[INFO] Tile 1/1 has been decoded.
[INFO] Image data has been updated with tile 1.

Successfully generated Outfile pacs.eg.jp2.png
--------------------------------------------------------------------
And - by the way - line 225 of opj_decompress.c in r2768 is wrong too:

    if(ext) {

This test is alwas true. But

    if(*ext) {

might be wrong e.g. for 'JPEG2000_input_file.' without extension.

PROBLEM 3: SYCC
===============

[OpenJPEG] j2k_to_image and opj_decompress

Two patches exist since March 2013:

 openjpeg-branch15-r2301-3/applications/codec/j2k_to_image.c 2013-03-11

 openjpeg-trunk-r2299-4/src/bin/jp2/opj_decompress.c 2013-03-11

winfried

Original comment by szukw...@arcor.de on 18 Mar 2014 at 5:24

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 19 Mar 2014 at 10:27

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2799.

Original comment by mathieu.malaterre on 25 Mar 2014 at 4:35

GoogleCodeExporter commented 9 years ago
I am using CMake just like the automated test suite. Would it be possible for 
you to update the autotools to use OPJ_BIG_ENDIAN ?

Original comment by mathieu.malaterre on 25 Mar 2014 at 4:37

GoogleCodeExporter commented 9 years ago
Here is a patch for configure.ac to allow to use OPJ_BIG_ENDIAN.

opj_config.h of LINUX LE:

/* define to 1 if your machine has BE */
/* #undef OPJ_BIG_ENDIAN */

/* define to 1 if your machine has BE */
/* #undef WORDS_BIGENDIAN */

winfried

Original comment by szukw...@arcor.de on 25 Mar 2014 at 9:07

Attachments:

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

Original comment by mathieu.malaterre on 26 Mar 2014 at 3:25

GoogleCodeExporter commented 9 years ago
Issue 242 has been merged into this issue.

Original comment by mathieu.malaterre on 26 Mar 2014 at 3:28