Niklas created IMAGING-274:
------------------------------
Summary: Corrupted TIFF output
Key: IMAGING-274
URL: https://issues.apache.org/jira/browse/IMAGING-274
Project: Commons Imaging
Issue Type: Bug
Components: Format: TIFF
Affects Versions: 1.0-alpha2, 1.0-alpha1
Reporter: Niklas
Attachments: 20171029_171217 - 20171029_171223-gps-corrupted.tif,
20171029_171217 - 20171029_171223-original.tif
I'm attempting to update GPS data in JPEG and TIFF files. The following example
results in corrupted TIFF files while working perfectly fine for JPEG:
{code:java}
try (BufferedOutputStream os = new BufferedOutputStream(new
FileOutputStream(dst))) {
if (metadata instanceof JpegImageMetadata) {
new
ExifRewriter().updateExifMetadataLossless(imageFile, os, outputSet);
} else if (metadata instanceof TiffImageMetadata) {
new
TiffImageWriterLossless(FileUtils.readFileToByteArray(imageFile)).write(os,
outputSet);
}
}
{code}
I attached both the original and the updated (corrupted) TIFF file with GPS
data. Some software (e.g. Windows Photos) is able to show the images with black
stripes, other software (including javax.ImageIO) is unable to read them at all.
And even though not exactly related to this issue: It would be really awesome
to have a similar ExifRewriter function for TIFF files!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)