QUERY_TIFF is a method of obtaining information about a TIFF image file without having to read the file. See QUERY_* Routines for more information.
Result = QUERY_TIFF ( Filename [, Info] [, IMAGE_INDEX=index] )
This routine returns a long with the value of 1 (one) if the query was successful (and the file type was correct) or 0 (zero) on failure.
A scalar string containing the pathname of the TIFF file to query.
Returns an anonymous structure containing information about the image in the file. The Info.TYPE field will return the value `TIFF'.
| Note |
Image number index. If this value is larger than the number of images in the file, the function returns 0 (failure).
This is an example of using QUERY_TIFF to write and read a multi-image TIFF file. The first image is a 16-bit, single channel image stored using compression. The second image is an RGB image stored using 32-bits/channel uncompressed.
; Write the image data:
data = FIX(DIST(256))
rgbdata = LONARR(3,320,240)
WRITE_TIFF,'multi.tif',data,COMPRESSION=1,/SHORT
WRITE_TIFF,'multi.tif',rgbdata,/LONG,/APPEND
; Read the image data back:
ok = QUERY_TIFF('multi.tif',s)
IF (ok) THEN BEGIN
FOR i=0,s.NUM_IMAGES-1 DO BEGIN
imp = QUERY_TIFF('multi.tif',t,IMAGE_INDEX=i)
img = READ_TIFF('multi.tif',IMAGE_INDEX=i)
HELP,t,/STRUCTURE
HELP,img
ENDFOR
ENDIF
Introduced: 5.2
QUERY_* Routines, READ_TIFF, WRITE_TIFF