Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

QUERY_TIFF


Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also

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.

Syntax

Result = QUERY_TIFF ( Filename [, Info] [, IMAGE_INDEX=index] )

Return Value

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.

Arguments

Filename

A scalar string containing the pathname of the TIFF file to query.

Info

Returns an anonymous structure containing information about the image in the file. The Info.TYPE field will return the value `TIFF'.

Note
In addition to the fields returned in the Info structure for all image types, there are a number of extra fields in the Info structure for TIFF images. See QUERY_TIFF-Specific Routine Info Structures for detailed structure info.

Keywords

IMAGE_INDEX

Image number index. If this value is larger than the number of images in the file, the function returns 0 (failure).

Examples

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 

Version History

Introduced: 5.2

See Also

QUERY_* Routines, READ_TIFF, WRITE_TIFF


Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]