Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set reduce_factor_may_fail #474

Closed
gcode-importer opened this issue Feb 14, 2015 · 1 comment
Closed

set reduce_factor_may_fail #474

gcode-importer opened this issue Feb 14, 2015 · 1 comment

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 474

This is the simplest solution (patch attached):

bin/opj_decompress -i Bretagne2.j2k  -o Bretagne2.j2k.png -r 8

[INFO] Start to read j2k main header (0).
[ERROR] Error decoding component 0.
The number of resolutions 8 to remove is >= the maximum of resolutions 6 of this component
=== Reduce to 5 ===

[ERROR] Error reading COD marker
[ERROR] Marker handler function failed to read the marker segment
ERROR -> opj_decompress: failed to read the header

winfried


Reported by szukw000 on 2015-02-14 06:12:08


- _Attachment: [reduce_factor_may_fail.dif](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-474/comment-0/reduce_factor_may_fail.dif)_
@szukw000
Copy link
Contributor

@detonin, here is an update proposal.

winfried

--- openjpeg/src/lib/openjp2/j2k.c.orig 2015-08-23 20:11:21.541979066 +0000
+++ openjpeg/src/lib/openjp2/j2k.c  2015-08-26 02:59:35.369928188 +0000
@@ -8751,8 +8751,8 @@

         /* If user wants to remove more resolutions than the codestream contains, return error */
         if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) {
-                opj_event_msg(p_manager, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
-                                        "of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
+                opj_event_msg(p_manager, EVT_ERROR, "Error decoding component %d.\n   == The number of resolutions to remove %d is > the possible number %d ==\n",
+                                        compno,l_cp->m_specific_param.m_dec.m_reduce,(l_tccp->numresolutions - 1));
                 p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/* FIXME J2K_DEC_STATE_ERR;*/
                 return OPJ_FALSE;
         }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants