You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Remi Malessa <re...@llgc.org.uk> on 2015/04/22 17:32:59 UTC
[sanselan] Writing TIFF back to a file
Hi there,
I am starting my work with Sanselan. I am trying to remove a Tag from a
TIFF file.
I managed to find the Tag and probably remove it too. Here's the code:
IImageMetadata tMetadata = Sanselan.getMetadata(tInputFile);
TiffImageMetadata tiffMetadata = (TiffImageMetadata) tMetadata;
outputSet = tiffMetadata.getOutputSet();
TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
exifDirectory.removeField(TiffConstants.EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT);
...but now, I can't make it to save it to the system. I am trying
something like this:
TiffImageWriterLossless writerLossLess = new
TiffImageWriterLossless(imageBytes);
writerLossLess.write(new FileOutputStream(toutputFile), outputSet);
...but I don't know where to get the data for the "imagesBytes".
Would much appreciate a hint.
Thanks
Remi
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [sanselan] Writing TIFF back to a file
Posted by Remi Malessa <re...@llgc.org.uk>.
Hi Benedikt,
Yes sorry, I planned to post a reply.
I switched to Commons Imaging libs:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-imaging</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
...and used one of the examples on the project's website:
https://svn.apache.org/repos/asf/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/ImageWriteExample.java
Regards
Remi
On 27/04/15 11:52, Benedikt Ritter wrote:
> Hello Remi,
>
> based on your second question I assume you have managed to resolve this
> problem yourself?
>
> br,
> Benedikt
>
> 2015-04-22 17:32 GMT+02:00 Remi Malessa <re...@llgc.org.uk>:
>
>> Hi there,
>>
>> I am starting my work with Sanselan. I am trying to remove a Tag from a
>> TIFF file.
>> I managed to find the Tag and probably remove it too. Here's the code:
>>
>> IImageMetadata tMetadata = Sanselan.getMetadata(tInputFile);
>> TiffImageMetadata tiffMetadata = (TiffImageMetadata) tMetadata;
>> outputSet = tiffMetadata.getOutputSet();
>> TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
>>
>> exifDirectory.removeField(TiffConstants.EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT);
>>
>> ...but now, I can't make it to save it to the system. I am trying
>> something like this:
>>
>> TiffImageWriterLossless writerLossLess = new
>> TiffImageWriterLossless(imageBytes);
>> writerLossLess.write(new FileOutputStream(toutputFile), outputSet);
>>
>> ...but I don't know where to get the data for the "imagesBytes".
>>
>> Would much appreciate a hint.
>>
>> Thanks
>>
>> Remi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [sanselan] Writing TIFF back to a file
Posted by Benedikt Ritter <br...@apache.org>.
Hello Remi,
based on your second question I assume you have managed to resolve this
problem yourself?
br,
Benedikt
2015-04-22 17:32 GMT+02:00 Remi Malessa <re...@llgc.org.uk>:
> Hi there,
>
> I am starting my work with Sanselan. I am trying to remove a Tag from a
> TIFF file.
> I managed to find the Tag and probably remove it too. Here's the code:
>
> IImageMetadata tMetadata = Sanselan.getMetadata(tInputFile);
> TiffImageMetadata tiffMetadata = (TiffImageMetadata) tMetadata;
> outputSet = tiffMetadata.getOutputSet();
> TiffOutputDirectory exifDirectory = outputSet.getExifDirectory();
>
> exifDirectory.removeField(TiffConstants.EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT);
>
> ...but now, I can't make it to save it to the system. I am trying
> something like this:
>
> TiffImageWriterLossless writerLossLess = new
> TiffImageWriterLossless(imageBytes);
> writerLossLess.write(new FileOutputStream(toutputFile), outputSet);
>
> ...but I don't know where to get the data for the "imagesBytes".
>
> Would much appreciate a hint.
>
> Thanks
>
> Remi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter