Peter van der Velde created XGC-101:
---------------------------------------

             Summary: When using #page= indicator on multipage tiff image only 
first page is displayed
                 Key: XGC-101
                 URL: https://issues.apache.org/jira/browse/XGC-101
             Project: XMLGraphicsCommons
          Issue Type: Bug
          Components: image codecs
    Affects Versions: 2.0.1
            Reporter: Peter van der Velde
            Priority: Minor


In the org.apache.xmlgraphics.image.loader.impl.PreloaderTIFF class 
createImageInfo function the '#page=' construction is handled correctly:
{code}
int pageIndex = ImageUtil.needPageIndexFromURI(uri);

            SeekableStream seekable = new SeekableStreamAdapter(in);
            TIFFDirectory dir;
            try {
                dir = new TIFFDirectory(seekable, pageIndex);
            } catch (IllegalArgumentException iae) {
                String errorMessage = MessageFormat.format(
                        "Subimage {0} does not exist.", new Object[] 
{pageIndex});
                throw new SubImageNotFoundException(errorMessage);
            }
{code}
In the org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawCCITTFax class 
loadImage function the first page is always loaded:
{code}
SeekableStream seekable = new SeekableStreamAdapter(in);
            dir = new TIFFDirectory(seekable, 0);
            TIFFField fld;
{code}
if the lines above are changed into:
{code}
SeekableStream seekable = new SeekableStreamAdapter(in);
            int pageIndex = 
ImageUtil.needPageIndexFromURI(info.getOriginalURI());
            try {
                dir = new TIFFDirectory(seekable, pageIndex);
            } catch (IllegalArgumentException iae) {
                String errorMessage = MessageFormat.format(
                        "Subimage {0} does not exist.", new Object[] 
{pageIndex});
                throw new SubImageNotFoundException(errorMessage);
            }
            TIFFField fld;
{code}
it works as expected. 

ImageLoaderInternalTIFF needs a similar fix...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to