| From | Sent On | Attachments |
|---|---|---|
| jai-...@javadesktop.org | Nov 6, 2007 3:39 pm | |
| robert engels | Nov 6, 2007 3:45 pm | |
| jai-...@javadesktop.org | Nov 6, 2007 6:25 pm | |
| jai-...@javadesktop.org | Nov 6, 2007 6:32 pm | |
| jai-...@javadesktop.org | Nov 7, 2007 1:40 am | |
| jai-...@javadesktop.org | Nov 7, 2007 3:04 am | |
| jai-...@javadesktop.org | Nov 7, 2007 3:15 am | |
| jai-...@javadesktop.org | Nov 7, 2007 4:02 am | |
| jai-...@javadesktop.org | Nov 7, 2007 7:10 am | |
| jai-...@javadesktop.org | Nov 7, 2007 7:29 am | |
| robert engels | Nov 7, 2007 7:35 am | |
| robert engels | Nov 7, 2007 7:51 am | |
| jai-...@javadesktop.org | Nov 7, 2007 7:54 am | |
| robert engels | Nov 7, 2007 7:56 am | |
| robert engels | Nov 7, 2007 9:06 am | |
| Bob Deen | Nov 7, 2007 2:51 pm | |
| robert engels | Nov 7, 2007 3:22 pm | |
| Andrey Kuznetsov | Nov 7, 2007 3:39 pm | |
| robert engels | Nov 7, 2007 3:42 pm | |
| Andrey Kuznetsov | Nov 7, 2007 4:01 pm | |
| robert engels | Nov 7, 2007 4:17 pm | |
| Andrey Kuznetsov | Nov 7, 2007 4:20 pm | |
| robert engels | Nov 7, 2007 4:32 pm | |
| mja...@union06.de | Nov 7, 2007 10:49 pm | |
| robert engels | Nov 8, 2007 10:34 am |
| Subject: | Re: [JAI-IMAGEIO] Read Tiff, Write Tiff... why are the files different size | |
|---|---|---|
| From: | robert engels (reng...@ix.netcom.com) | |
| Date: | Nov 7, 2007 7:35:39 am | |
| List: | net.java.dev.jai-imageio.interest | |
It is my understanding:
if you open a JPEG file, AND either
1. write it as a TIFF (using JPEG in TIFF compression, with compression turned on), you are going to get a TIFF that looks much worse than the original JPEG 2. write it as a TIFF with compression turned off, you are going to get a file that is much larger than the original JPEG.
On Nov 7, 2007, at 9:30 AM, jai-...@javadesktop.org wrote:
This question brings up a good point... I don't think it is possible to read an image that uses lossly compression, and rewrite it changing some of the metadata - if you don't set the compression, the file will become large, if you set the compression then the image is compressed again (multiplying the error).
Exactly.
It seems you would need to be able to extract the compressed stream from the original image, and write it out verbatim.
Any ideas?
There is API for doing this stuff in Java Image I/O but nothing implements it at the moment:
http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ ImageWriter.html#canReplaceImageMetadata(int) http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ ImageWriter.html#replaceImageMetadata(int,%20javax.ima geio.metadata.IIOMetadata)
If it were implemented say for the TIFF writer what would happen is that an ImageOutputStream would be opened on an existing TIFF file and then the metadata would be replaced. Probably the way the implementation would have to work would be to copy the old IFD to a new one taking account of the updated metadata and then replace the old IFD in the linked list of IFDs with the new one. This would in effect "orphan" the old IFD and result in a file containing unused space.
Once again, I suggest that an ENHANCEMENT request be filed in the jai-imageio-core project to track this.
Brian
I thought I was following ... but now I'm a little unsure. It makes sense to me that what I would want to write the image from the original JPEG-in-TIFF image file to the new multipage TIFF verbatim - to eliminate the additional loss of compressing again. The part that confuses me is the need to change the metadata.
The only change to the file is that it is now inside a multipage TIFF. I assume that the writeInsert() method takes care of adding in the information for the next IFD when I add a new page, so what part of the metadata would I need to change or replace?
Is there a way to read and write out that compressed JPEG stream exactly as is?
And thanks so much everyone for your help! -Mary [Message sent by forum member 'chickiboo' (chickiboo)]
http://forums.java.net/jive/thread.jspa?messageID=244302
--------------------------------------------------------------------- To unsubscribe, e-mail: inte...@jai-imageio.dev.java.net For additional commands, e-mail: interest-help@jai- imageio.dev.java.net





