Reading general file information

It is often useful to obtain some information about the file, like the number of channels it contains, and their dimensions. This information can be obtained once the file has been opened using the DBPixels(), DBLines(), and DBChannels() intrinsics:

local int NumberOfChannels, PixelSize, LineSize
PixelSize = DBPixels( fd )
LineSize = DBLines( fd )
NumberOfChannels = DBChannels( fd )
if ( NumberOfChannels < 1 ) then
  printf "The file %s contains no image data!\n", FileName
return
endif

The type of a data channel can be determined using the DBChanType() intrinsic function. This intrinsic returns one of the strings

representing the four possible data types supported.

printf "The first channel in the file is of type %s\n", \
DBChanType( fd, 1 )

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.