Question

BACKGROUND: My application allows users to select which directory in a multi-page tiff they want to view and draw shapes onto. Simple shapes such as a circle or square are allowed.

ISSUE: After a user has edited one of the images in my multi-page tiff, is it possible to update just the modified directories? It doesn't appear you can do this with the libtiff.net api.

It appears I need to recreate the entire tiff and each directory to handle this scenario.

Thanks,

Was it helpful?

Solution

I am afraid, it's not possible to change only one directory in a TIFF using the library in general case.

You could rewrite the directory so it will point to the other place in file (where you put changed raster data). This approach will cause unnecessary file size increases due to raster duplication, though.

You could replace raster and directory in-place but in most cases changed raster won't have the same size and you might easily run into different kind of corruption issues.

So, I would recommend you to purse "recreate the entire tiff" approach.

Don't forget that you might copy unchanged raster data without decompression/recompression.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top