[jira] [Commented] (IMAGING-113) Cannot read multipage tiff
[ https://issues.apache.org/jira/browse/IMAGING-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16105484#comment-16105484 ] Gary Gregory commented on IMAGING-113: -- JIRA is not a support forum, please ask on the user's mailing list: https://commons.apache.org/mail-lists.html > Cannot read multipage tiff > -- > > Key: IMAGING-113 > URL: https://issues.apache.org/jira/browse/IMAGING-113 > Project: Commons Imaging > Issue Type: Bug >Affects Versions: 1.0 >Reporter: Adrian Costil > Labels: multipage, tiff > Fix For: 1.0 > > > I get the error below when I'm trying to read a multipage tiff file as a list > of images > final List images = > Imaging.getAllBufferedImages(new File(imageLocation)); > line 589 of TiffImageParser > Rectangle subImage = checkForSubImage(params); //if the params is > null it will crash > java.lang.NullPointerException > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getIntegerParameter(TiffImageParser.java:513) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.checkForSubImage(TiffImageParser.java:531) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:589) > at > org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getAllBufferedImages(TiffImageParser.java:499) > at > org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1210) > at > org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1202) > at TestWriteTiffImages.main(TestWriteTiffImages.java:30) -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IMAGING-113) Cannot read multipage tiff
[ https://issues.apache.org/jira/browse/IMAGING-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16104936#comment-16104936 ] Venkataraman K commented on IMAGING-113: Hello. I am new to apache jira. I have faced this issue and would like to get the fix downloaded. Can someone help me in downloading this fix ? It is asking me to validate using fisheye and i am not sure how to do it. Thanks in advance > Cannot read multipage tiff > -- > > Key: IMAGING-113 > URL: https://issues.apache.org/jira/browse/IMAGING-113 > Project: Commons Imaging > Issue Type: Bug >Affects Versions: 1.0 >Reporter: Adrian Costil > Labels: multipage, tiff > Fix For: 1.0 > > > I get the error below when I'm trying to read a multipage tiff file as a list > of images > final List images = > Imaging.getAllBufferedImages(new File(imageLocation)); > line 589 of TiffImageParser > Rectangle subImage = checkForSubImage(params); //if the params is > null it will crash > java.lang.NullPointerException > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getIntegerParameter(TiffImageParser.java:513) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.checkForSubImage(TiffImageParser.java:531) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:589) > at > org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getAllBufferedImages(TiffImageParser.java:499) > at > org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1210) > at > org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1202) > at TestWriteTiffImages.main(TestWriteTiffImages.java:30) -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (IMAGING-113) Cannot read multipage tiff
[ https://issues.apache.org/jira/browse/IMAGING-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13801830#comment-13801830 ] Adrian Costil commented on IMAGING-113: --- the patch seems to work. I was facing another issue with my test tiff image which has 14 images, each 3386 x 4397. The library uses a lot of memory for Imaging.getAllBufferedImages(new File(imageLocation)); so I had to start the JVM with a lot of memory to process a single image file. -Xms512m -Xmx1024m Is there a way to improve the memory usage ? Also I was trying to write to a different file and it seems that it will write only the last image. Is there a way to append the images to a tiff file ? this is a sample code: final ListBufferedImage images = Imaging.getAllBufferedImages(new File(imageLocation)); final ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF; final MapString,Object params = new HashMapString,Object(); // set optional parameters if you like params.put(ImagingConstants.PARAM_KEY_COMPRESSION, new Integer( TiffConstants.TIFF_COMPRESSION_LZW)); int i= 0; File outFile = new File(outLocation); for (IteratorBufferedImage iterator = images.iterator(); iterator.hasNext(); i++) { BufferedImage bufferedImage = iterator.next(); System.out.println(write image + i); Imaging.writeImage(bufferedImage, outFile, format, params); } Cannot read multipage tiff -- Key: IMAGING-113 URL: https://issues.apache.org/jira/browse/IMAGING-113 Project: Commons Imaging Issue Type: Bug Affects Versions: 1.0 Reporter: Adrian Costil Labels: multipage, tiff Fix For: 1.0 I get the error below when I'm trying to read a multipage tiff file as a list of images final ListBufferedImage images = Imaging.getAllBufferedImages(new File(imageLocation)); line 589 of TiffImageParser Rectangle subImage = checkForSubImage(params); //if the params is null it will crash java.lang.NullPointerException at org.apache.commons.imaging.formats.tiff.TiffImageParser.getIntegerParameter(TiffImageParser.java:513) at org.apache.commons.imaging.formats.tiff.TiffImageParser.checkForSubImage(TiffImageParser.java:531) at org.apache.commons.imaging.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:589) at org.apache.commons.imaging.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163) at org.apache.commons.imaging.formats.tiff.TiffImageParser.getAllBufferedImages(TiffImageParser.java:499) at org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1210) at org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:1202) at TestWriteTiffImages.main(TestWriteTiffImages.java:30) -- This message was sent by Atlassian JIRA (v6.1#6144)