ADC Home > Reference Library > Technical Q&As > QuickTime > Import & Export >

Exporting TIFF files in little-endian format


Q: I'd like to use the QuickTime graphics exporters to export a TIFF image in little-endian format. However, I'd like to do this without having to display the export dialog via the GraphicsExportRequestSettings function. Is this possible?

A: Yes. The QuickTime TIFF graphics exporter looks for an atom of type kQTTIFFLittleEndian (see ImageCompression.h) in the export settings atom container. The data associated with this atom is a single byte (type UInt8). If the data value in this atom is set to 1, then the graphics exporter will write a little-endian TIFF. Listing 1 below contains a short code snippet showing how to construct the export settings container with this atom for the TIFF exporter:



 QTAtomContainer ac = nil;
QTAtom videAtom;
UInt8 aChar;
err = QTNewAtomContainer( &ac );
err = QTInsertChild( ac, kParentAtomIsContainer, kQTSettingsVideo, 1, 0, 0,
nil, &videAtom );
aChar = true;
err = QTInsertChild( ac, videAtom, kQTTIFFLittleEndian, 1, 0, sizeof(aChar),
&aChar, nil );
err = GraphicsExportSetSettingsFromAtomContainer( graphicsExporterInstance,
ac );
QTDisposeAtomContainer( ac );

Listing 1. Constructing the export settings container




[Jun 26 2001]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.