Is there an easy way to remove/drop a layer/page/directory from a tiff/svs file in C#? I am looking to remove a specific page from a series of tiff/svs files that is simple. It would be nice if it were something like tifFile.dropLayer(0)
rather than needing to copy everything from within to a copy. I have tried LibTiff for a good solution, but that is more complicated than I would prefer. I tried using their UnlinkDirectory()
method, but the layer still shows after the fact (unless there is a save call or something I am missing. For that, I was doing:
using (Tiff tif = Tiff.Open(fileName, "a"))
{tif.UnlinkDirectory(4);}
I thought that it saved and wrote on the Close()
method and that got invoked on Dispose()
. I just need a simple open source library or some other way in .NET to accomplish this task.