You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Remigiusz Malessa (JIRA)" <ji...@apache.org> on 2015/04/27 15:34:39 UTC
[jira] [Updated] (IMAGING-170) TIFF image gains significant size
using TiffImageWriterLossless
[ https://issues.apache.org/jira/browse/IMAGING-170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Remigiusz Malessa updated IMAGING-170:
--------------------------------------
Description:
Good afternoon,
I am posting an issue report as suggested by mr Benedikt Ritter. It's my first issue report and I've just recently started using the Commons Imaging, so please go easy on me.
------------------------------------------------
Using Commons Imaging I am reading a Tiff image (will attempt to attach it to this ticket), then I remove a tag (Focal Plane Resolution Unit) and then I save the new TiffOutputSet to the system using TiffImageWriterLossless.
The original image is 15MB, the new image (with the Tag removed) is 28MB.
Here's how I do it:
{code|borderStyle=solid}
File tInputFile = new File("/home/rem/TEMP/tags.original.tif");
File toutputFile = new File("/home/rem/TEMP/tags.new.tif");
final BufferedImage image = Imaging.getBufferedImage(tInputFile);
ImageMetadata tMetadata = Imaging.getMetadata(tInputFile);
TiffImageMetadata imageMetadata = (TiffImageMetadata) tMetadata;
outputSet = imageMetadata.getOutputSet();
TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
exifDirectory.removeField(41488);
ImageFormats format = ImageFormats.TIFF;
Map<String, Object> params = new HashMap<String, Object>();
BufferedImage image = Imaging.getBufferedImage(tInputFile);
byte[] bytes = Imaging.writeImageToBytes(image, format, params);
TiffImageWriterLossless writerLossLess = new TiffImageWriterLossless(bytes);
writerLossLess.write(os, outputSet);
{code}
was:
Good afternoon,
I am posting an issue report as suggested by mr Benedikt Ritter. It's my first issue report and I've just recently started using the Commons Imaging, so please go easy on me.
------------------------------------------------
Using Commons Imaging I am reading a Tiff image (will attempt to attach it to this ticket), then I remove a tag (Focal Plane Resolution Unit) and then I save the new TiffOutputSet to the system using TiffImageWriterLossless.
The original image is 15MB, the new image (with the Tag removed) is 28MB.
Here's how I do it:
File tInputFile = new File("/home/rem/TEMP/tags.original.tif");
File toutputFile = new File("/home/rem/TEMP/tags.new.tif");
final BufferedImage image = Imaging.getBufferedImage(tInputFile);
ImageMetadata tMetadata = Imaging.getMetadata(tInputFile);
TiffImageMetadata imageMetadata = (TiffImageMetadata) tMetadata;
outputSet = imageMetadata.getOutputSet();
TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
exifDirectory.removeField(41488);
ImageFormats format = ImageFormats.TIFF;
Map<String, Object> params = new HashMap<String, Object>();
BufferedImage image = Imaging.getBufferedImage(tInputFile);
byte[] bytes = Imaging.writeImageToBytes(image, format, params);
TiffImageWriterLossless writerLossLess = new TiffImageWriterLossless(bytes);
writerLossLess.write(os, outputSet);
> TIFF image gains significant size using TiffImageWriterLossless
> ---------------------------------------------------------------
>
> Key: IMAGING-170
> URL: https://issues.apache.org/jira/browse/IMAGING-170
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: TIFF
> Affects Versions: 1.0
> Environment: System: Fedora release 21, kernel version: 3.18.7-200.fc21.x86_64, JAVA: openjdk version "1.8.0_31", IDE: Eclipse Kepler 2, Build id: 20140224-0627
> Reporter: Remigiusz Malessa
> Priority: Minor
>
> Good afternoon,
> I am posting an issue report as suggested by mr Benedikt Ritter. It's my first issue report and I've just recently started using the Commons Imaging, so please go easy on me.
> ------------------------------------------------
> Using Commons Imaging I am reading a Tiff image (will attempt to attach it to this ticket), then I remove a tag (Focal Plane Resolution Unit) and then I save the new TiffOutputSet to the system using TiffImageWriterLossless.
> The original image is 15MB, the new image (with the Tag removed) is 28MB.
> Here's how I do it:
> {code|borderStyle=solid}
> File tInputFile = new File("/home/rem/TEMP/tags.original.tif");
> File toutputFile = new File("/home/rem/TEMP/tags.new.tif");
> final BufferedImage image = Imaging.getBufferedImage(tInputFile);
> ImageMetadata tMetadata = Imaging.getMetadata(tInputFile);
> TiffImageMetadata imageMetadata = (TiffImageMetadata) tMetadata;
> outputSet = imageMetadata.getOutputSet();
> TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
> exifDirectory.removeField(41488);
> ImageFormats format = ImageFormats.TIFF;
> Map<String, Object> params = new HashMap<String, Object>();
> BufferedImage image = Imaging.getBufferedImage(tInputFile);
> byte[] bytes = Imaging.writeImageToBytes(image, format, params);
> TiffImageWriterLossless writerLossLess = new TiffImageWriterLossless(bytes);
> writerLossLess.write(os, outputSet);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)