You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Lucas (Jira)" <ji...@apache.org> on 2023/09/26 16:59:00 UTC
[jira] [Created] (IMAGING-364) NullPointerException in TiffDirectory.getTiffImage()
Gary Lucas created IMAGING-364:
----------------------------------
Summary: NullPointerException in TiffDirectory.getTiffImage()
Key: IMAGING-364
URL: https://issues.apache.org/jira/browse/IMAGING-364
Project: Commons Imaging
Issue Type: Bug
Components: Format: TIFF
Affects Versions: 1.0-alpha3
Reporter: Gary Lucas
When calling TiffDirectory.getTiffImage(), Commons Imaging throws a null pointer exception. If you call the alternate method TiffDirectory.getTiffImage(TiffImagingParameters), it works okay. The problem is that the internal method TiffImageParser().getBufferedImage() cannot handle a null reference.
Here's the problematic code.
{code:java}
public BufferedImage getTiffImage() throws ImagingException, IOException {
if (null == abstractTiffImageData) {
return null;
}
return new TiffImageParser().getBufferedImage(
this, headerByteOrder, null);
}
{code}
We could either make TiffImageParser more robust, or we could avoid passing in a null value for the third argument.
{code:java}
TiffImagingParameters defaultParameters = new TiffImagingParameters();
return new TiffImageParser().getBufferedImage(
this, headerByteOrder, defaultParameters);{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)