I couldn't find any proper way of doing that, except manually reading the file, rewriting image data as read and patching through the TIFF fields positions/offsets ...
Change TIFF header only without re-writing image content
Domanda
I am using JAI to read/write multi-page TIFFs containing different type of images (different sizes, different compression methods) and I have to read the file, change a few values in the TIFF headers of the pages and write these headers back without changing image content/compression.
Though I am able to read all pages and headers, modify the headers and re-write the whole TIFF, I am concerned about the time needed for recompression, especially when the "main" image is already JPEG-compressed, multiple read/write would loose more and more data.
I already thought about two things:
- Write specific header content to mark positions in file and hack into it to change
- Write a JNI wrapper on top of C libtiff (but I would rather not)
If possible, I would prefer to do it all with JAI.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow