Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 54379 invoked from network); 9 Sep 2010 19:36:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 19:36:59 -0000 Received: (qmail 69719 invoked by uid 500); 9 Sep 2010 19:36:59 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69590 invoked by uid 500); 9 Sep 2010 19:36:58 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69582 invoked by uid 99); 9 Sep 2010 19:36:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 19:36:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 19:36:58 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o89JabAx024053 for ; Thu, 9 Sep 2010 19:36:37 GMT Message-ID: <23784963.101221284060997191.JavaMail.jira@thor> Date: Thu, 9 Sep 2010 15:36:37 -0400 (EDT) From: "Charles Matthew Chen (JIRA)" To: issues@commons.apache.org Subject: [jira] Resolved: (SANSELAN-38) JpegImageMetadata getEXIFThumbnail only works on Jpeg thumbnails stored as Tiff images. In-Reply-To: <1247711933.216701268355147233.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SANSELAN-38?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Charles Matthew Chen resolved SANSELAN-38. ------------------------------------------ Resolution: Fixed Commited patch from James EJ. Added image from James EJ to test suite. http://svn.apache.org/viewvc?view=revision&revision=995556 > JpegImageMetadata getEXIFThumbnail only works on Jpeg thumbnails stored as Tiff images. > --------------------------------------------------------------------------------------- > > Key: SANSELAN-38 > URL: https://issues.apache.org/jira/browse/SANSELAN-38 > Project: Commons Sanselan > Issue Type: Bug > Environment: Windows Vista, Java 6 SE, incubator 0.97 and 0.98 SNAPSHOT > Reporter: James E-J > Attachments: img_F028c_small.jpg, jamesEJ_jpeg_patch.txt > > Original Estimate: 0.33h > Remaining Estimate: 0.33h > > JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata; > BufferedImage image = jpegMetadata.getEXIFThumbnail(); > Above code seaches tiff directory structure but only searches for dir.getTiffImage() and only checks if tiffImageData is null. Jpeg files which have Jpeg thumbs stored as JpegImageData do not work. > I was able to fix this with following code: > import org.apache.sanselan.formats.tiff.JpegImageData; > import javax.imageio.ImageIO; > import java.io.ByteArrayInputStream; > public BufferedImage getEXIFThumbnail() throws ImageReadException, > IOException { > ArrayList dirs = exif.getDirectories(); > for (int i = 0; i < dirs.size(); i++) { > TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) dirs > .get(i); > // Debug.debug("dir", dir); > BufferedImage image = dir.getThumbnail(); > if (null != image) > return image; > JpegImageData jpegImageData = dir.getJpegImageData(); > if(jpegImageData!=null){ > ByteArrayInputStream input = new ByteArrayInputStream(jpegImageData.data); > image = ImageIO.read(input); > if (image!=null) > return image; > } > } > return null; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.