Hello amyspark, My understanding is that you set the magic TIFFTAG_SUBIFD tag on a directory with an $n element array of offsets, all initialized to 0, and then the next $n TIFF directories you write will appear as subdirectories of this directory, with the offsets filled in for you.
Or that's what I did here and it seems to work for me: https://github.com/libvips/libvips/blob/master/libvips/foreign/vips2tiff.c#L2127-L2141 John On Fri, 9 Dec 2022 at 12:26, <[email protected]> wrote: > > The page I followed when implementing TIFF subframe writing is: > > https://stackoverflow.com/questions/11959617/in-a-tiff-create-a-sub-ifd-with-thumbnail-libtiff > > HTH > Paavo > > > -----Original Message----- > From: Tiff <[email protected]> On Behalf Of L. E. Segovia via Tiff > Sent: reede, 9. detsember 2022 03:29 > To: [email protected] > Subject: [Tiff] How to write multi-file TIFFs > > Hi all, > > I'm writing to ask about how to create a TIFF with multiple sub-images. > Our writing code at Krita is unable to create this kind of files, creation > fails with these lines logged: > > > krita.file: "TIFFLinkDirectory: Error fetching directory count" > > krita.file: "TIFFRewriteDirectory: Error fetching directory count" > > A breakpoint on the TIFF error writing routine shows that both are issued the > moment I call TIFFWriteDirectory for the second and further layers. > TIFFCreateDirectory, which I saw suggested in tif_overview.c, does not have > an effect here. > > Does anyone know the correct incantations to create this kind of files? > I'm running LibTiff 4.4.0 at present. > > Best, > > amyspark > > -- > amyspark 🌸 https://www.amyspark.me > _______________________________________________ > Tiff mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/tiff > > _______________________________________________ > Tiff mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/tiff _______________________________________________ Tiff mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/tiff
