You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nikhil (Jira)" <ji...@apache.org> on 2022/11/09 10:11:00 UTC

[jira] [Created] (IMAGING-338) Sanselan returns an empty set when retrieving the image metadata

Nikhil created IMAGING-338:
------------------------------

             Summary: Sanselan returns an empty set when retrieving the image metadata
                 Key: IMAGING-338
                 URL: https://issues.apache.org/jira/browse/IMAGING-338
             Project: Commons Imaging
          Issue Type: Bug
    Affects Versions: 0.97
            Reporter: Nikhil


We were using Sanselan to extract IPTC metadata. Recently there were images thats causing Sanselan to return an empty set when retrieving the metadata, despite the fact that there is clearly iptc metadata in the image.

 

The problem is seen in the following codebase

IPTCParser.parseIPTCBlock(...), and is the second 'if' statement within the
while loop. In particular, instead of the following:
if (tagMarker != IPTC_RECORD_TAG_MARKER) {
  if (verbose) {
      System.out.println("Unexpected record tag marker in IPTC data.");
  }
  {*}return elements{*};
 }

 

You should do the following to fix the issue:

 

if (tagMarker != IPTC_RECORD_TAG_MARKER) {
  if (verbose) {
      System.out.println("Unexpected record tag marker in IPTC data.");
  }
  *continue;*
}

 

Credit @ [https://www.mail-archive.com/sanselan-dev@incubator.apache.org/msg00430.html] for the detailed notes



--
This message was sent by Atlassian Jira
(v8.20.10#820010)