Closed GoogleCodeExporter closed 9 years ago
And where is this JPX file?
winfried
Original comment by szukw...@arcor.de
on 9 Mar 2013 at 5:03
I apologize but I wasn't able to get it until today. Here are the two files
extracted from the page. The first has no issues; the second reports the
problems I mentioned.
-e
Original comment by ed.porras@icloud.com
on 11 Mar 2013 at 5:32
The file p16-2.jp2 has an ICC profile but a meth of 4:
-------------- ICC Profile[0] ---------------
cmmtype(0) version(0.0.0.0) class()
color-space() profile-connection-space(jp2c)
date(44.65361.65359) time(0:0:355)
signature() platform-signature()
profile-flags(0) [0]0 [1]0 [2:15]0
device-attr(0) white(0) negative(0) matte(0) transparent(0)
rendering-intent(0x20701)
CIE: x(263.257) y(65362.12) z(1.1)
-----------------------------------------------
read_colr
meth(4) prec(2) approx(1) enumcs[0] cs()
The SPEC says:
ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values
Value Comment
1 Enumerated Colourspace
2 Restricted ICC profile
other value Reserved for other ISO use. If the value of METH is
not 1 or 2, there may be fields in this box following the
APPROX field, and a conforming JP2 reader shall ignore the
entire Colour Specification box.
I have now made changes for the BRANCH15:
--- openjpeg-branch15-r2301-4/libopenjpeg/jp2.c.v07 2013-03-13
17:48:08.948600301 +0100
+++ openjpeg-branch15-r2301-4/libopenjpeg/jp2.c 2013-03-13 17:36:45.090567624
+0100
@@ -665,12 +665,12 @@
}
}
else
- if(jp2->meth == 3)
+ if(jp2->meth > 2)
{
/* ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values:
conforming JP2 reader shall ignore the entire Colour Specification box.
*/
- cio_skip(cio, box->length);
+ return OPJ_FALSE;
}
if (cio_tell(cio) - box->init_pos != box->length)
@@ -797,7 +797,7 @@
#endif
/* Part 1, I.5.3.3 : 'must contain at least one' */
- return (color->jp2_has_colr == 1);
+ return (color->jp2_has_colr == 1 || jp2->meth > 2);
}/* jp2_read_jp2h() */
'opj_read_colr()' returns OPJ_FALSE so that another COLR
box with a correct METH value can be analyzed.
But now the return value must be changed:
return (color->jp2_has_colr == 1 || jp2->meth > 2);
There has no other COLR box found, and j2k_to_image()
returns with success.
The change for the TRUNK is different:
--- openjpeg-trunk-r2299-5/src/lib/openjp2/jp2.c.v04 2013-03-13
17:14:05.262502647 +0100
+++ openjpeg-trunk-r2299-5/src/lib/openjp2/jp2.c 2013-03-13
17:38:54.876573826 +0100
@@ -1135,22 +1135,12 @@
}
else
- if(jp2->meth == 3)
+ if(jp2->meth > 2)
{
/* ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values:
conforming JP2 reader shall ignore the entire Colour Specification box.
*/
-#ifdef UNUSED_CODE
- OPJ_INT32 i;
-
- i = p_colr_header_size - 3;
-
- while(--i >= 0)
- {
- opj_read_bytes(p_colr_header_data,&l_value,1);
- ++p_colr_header_data;
- }
-#endif /* UNUSED_CODE */
+ return OPJ_TRUE;
}
else
opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth);
The UNUSED_CODE can be removed completely, OPJ_TRUE is returned,
and 'opj_decompress()' returns with success because the variable
'color->jp2_has_colr' is only tested in the TRUNK at the beginning
of 'opj_jp2_read_colr()' and then never again.
winfried
Original comment by szukw...@arcor.de
on 13 Mar 2013 at 4:41
Attachments:
I have forgotten to press the STAR button.
winfried
Original comment by szukw...@arcor.de
on 13 Mar 2013 at 4:43
Original comment by mathieu.malaterre
on 25 Feb 2014 at 3:30
This issue was updated by revision r2488.
Original comment by mathieu.malaterre
on 26 Feb 2014 at 4:30
This issue was closed by revision r2489.
Original comment by mathieu.malaterre
on 26 Feb 2014 at 4:31
Original issue reported on code.google.com by
ed.porras@icloud.com
on 8 Mar 2013 at 10:26Attachments: