<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 0.22.0 does not find openjpeg-2.0.0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=58906#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 0.22.0 does not find openjpeg-2.0.0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=58906">bug 58906</a>
              from <span class="vcard"><a class="email" href="mailto:Thomas.Freitag@alfa.de" title="Thomas Freitag <Thomas.Freitag@alfa.de>"> <span class="fn">Thomas Freitag</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=85114" name="attach_85114" title="new attempt for openjpeg2 support">attachment 85114</a> <a href="attachment.cgi?id=85114&action=edit" title="new attempt for openjpeg2 support">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=58906&attachment=85114'>[review]</a>
new attempt for openjpeg2 support

When try to render  when rendering
<a href="http://www.eci.org/_media/downloads/altona_test_suite/eci_altona-test-suite-v2_technical2_x4.pdf">http://www.eci.org/_media/downloads/altona_test_suite/eci_altona-test-suite-v2_technical2_x4.pdf</a>
with Your patch for openjpeg2, I got a huge number of error messages and no one
of the jp2 compressed images were shown. I tried it also with the actual master
version of openjpeg 2.x available over svn, but then I got immediately an
assert.

1. I looked a little bit around and found out, that we have to set the
user_data_length with opj_stream_set_user_data_length to avoid the assert,
therefore I went back to read the complete jp2 stream into memory first to get
a correct length for the stream.
2. Then I discovered that we have to implement the skip_function and have to
return always the input value, even if it tries to skip over the end of the
stream.

With these corrections I was able to render the PDF nearly completely, only two
images are missing in the rendered output. But these two images are images in
LAB colorspace, and it seems, as if openjpeg has no support for LAB images. 

@Adrian: I don't know which PDFs causes Your regressions, but I think that
there is a great chance that my patch solves that, too. So it would be nice if
You can tell me what are the problematic PDFs and / or test my patch with these
PDF again.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>