[
https://issues.apache.org/jira/browse/IMAGING-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14321637#comment-14321637
]
Michael Groß commented on IMAGING-163:
--------------------------------------
I propose a patch at
http://github.com/mgmechanics/commons-imaging/tree/IMAGING-163
The patch solves this issue by replacing the abstract method getXmpXml in
abstract class org.apache.commons.imaging.ImageParser by an implementation
which returns null.
This way was choosen because all classes implementing ImageParser implemented
either a method returning a string with xmp-xml (5 of 16 classes implementing
ImageParser) or returning null (11 of 16). So returning null IS currently the
default implementation if a class implementing ImageParser can not return an
xmp-xml string.
Without the fix one would only know if reading all of the 16 classes
implementing ImageParser; now a look at class ImageParser makes clear that
returning null is the default implementation if one can not return an xmp-xml
string for this image format.
> DcxImageParser.getXmpXml() always returns null
> ----------------------------------------------
>
> Key: IMAGING-163
> URL: https://issues.apache.org/jira/browse/IMAGING-163
> Project: Commons Imaging
> Issue Type: Improvement
> Reporter: Michael Groß
> Fix For: Review Patch
>
>
> Affects PCX format - can't spot this format in "Components" field.
> org.apache.commons.imaging.formats.dcx.DcxImageParser.getXmpXml() always
> returns null
> {noformat}
> /**
> * Extracts embedded XML metadata as XML string.
> * <p>
> *
> * @param byteSource
> * File containing image data.
> * @param params
> * Map of optional parameters, defined in ImagingConstants.
> * @return Xmp Xml as String, if present. Otherwise, returns null.
> * @throws org.apache.commons.imaging.ImageReadException
> * @throws java.io.IOException
> */
> @Override
> public String getXmpXml(final ByteSource byteSource, final
> ImagingParameters params)
> throws ImageReadException, IOException {
> return null;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)