From sanselan-dev-return-398-apmail-incubator-sanselan-dev-archive=incubator.apache.org@incubator.apache.org Sun Mar 01 18:05:34 2009 Return-Path: Delivered-To: apmail-incubator-sanselan-dev-archive@minotaur.apache.org Received: (qmail 94682 invoked from network); 1 Mar 2009 18:05:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Mar 2009 18:05:34 -0000 Received: (qmail 17001 invoked by uid 500); 1 Mar 2009 18:05:34 -0000 Delivered-To: apmail-incubator-sanselan-dev-archive@incubator.apache.org Received: (qmail 16981 invoked by uid 500); 1 Mar 2009 18:05:34 -0000 Mailing-List: contact sanselan-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sanselan-dev@incubator.apache.org Delivered-To: mailing list sanselan-dev@incubator.apache.org Received: (qmail 16968 invoked by uid 99); 1 Mar 2009 18:05:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Mar 2009 10:05:33 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Mar 2009 18:05:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C5F0C234C48C for ; Sun, 1 Mar 2009 10:05:12 -0800 (PST) Message-ID: <153331549.1235930712796.JavaMail.jira@brutus> Date: Sun, 1 Mar 2009 10:05:12 -0800 (PST) From: "Charles Matthew Chen (JIRA)" To: sanselan-dev@incubator.apache.org Subject: [jira] Commented: (SANSELAN-18) Sanselan 0.97 - GIF Parser facilities return null values for xmp In-Reply-To: <531562090.1235453161739.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SANSELAN-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677824#action_12677824 ] Charles Matthew Chen commented on SANSELAN-18: ---------------------------------------------- getXmpXml() returns null if no XMP data is found in the image file. Also, you might be seeing an issue due to the way you're reading your file. is.read() isn't guaranteed to read the entire stream - you'll need to loop read()s. You're also not buffering the stream, which makes a significant performance difference. Sanselan's ByteSources deal with these issues; I suggest the much easier: File file = new File("C:/data/TestGIF.gif"); String xmp = Sanselan.getXmpXml(file); if(null != xmp) { System.out.println(existingXMP); } else { System.out.println("Image contains no xmp data."); } > Sanselan 0.97 - GIF Parser facilities return null values for xmp > ---------------------------------------------------------------- > > Key: SANSELAN-18 > URL: https://issues.apache.org/jira/browse/SANSELAN-18 > Project: Sanselan > Issue Type: Bug > Environment: Windows XP, JDK 1.5 > Reporter: Kelly Boettcher > Attachments: TestGIF.gif > > > When attempting to use both core Sanselan methods and GIFParser methods, attempts to retrieve XMP is resulting in null values. Example code below: > File file; > InputStream is; > byte[] b; > file = new File("C:/data/TestGIF.gif"); > is = new FileInputStream(file); > b = new byte[is.available()]; > is.read(b); > is.close(); > > /* Testing the Sanselan getXMP */ > String xmp = Sanselan.getXmpXml(file); // returns null > System.out.println(xmp); > > /* Testing the GIF image parser's xmp capabilities */ > GifImageParser parser = new GifImageParser(); > ByteSource bs = new ByteSourceArray(b); > String existingXMP = parser.getXmpXml(bs, null); // returns null > System.out.println(existingXMP); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.