GS-Base Help > Using objectStats() Functions to Obtain File/Image Data

objectStats(field, type)

objectStats(field, imageName, propertyType)

Returns Images/Files field statistics, or the metadata encoded in JPG/TIFF/PNG images (e.g. by digital cameras).

objectStats(field, type)

type = 0 - returns the number of objects
type = 1 - returns the size in bytes of the biggest object in a field
type = 2 - returns the size in bytes of the smallest object in a field
type = 3 - returns 1 if a field contains images (in a format supported by GS-Base), or 0 otherwise.
To obtain the total physical size of the Images/Files field, use the len() function.

objectStats(field, imageName, propertyType)

NOTE: this function should be used in calculated Text fields.
imageName - if there are multiple images in a field, you can specify the name of a given image; if you specify an empty string, the first image from the field will be used.
propertyType - a numeric property code; to generate a list of all possible codes for a given image, specify -1.

=objectStats(files, 0)
=objectStats(images, 1)
=objectStats(images, "", hex2dec("132"))

Returns the 0x132 property value (a date).

=objectStats(images, "some_image.jpg", hex2dec("132"))

Returns the 0x132 property value for a given image.

=objectStats(images, "", -1)

Returns the list of all properties encoded in a given image.

Property values can be read for JPG/TIFF/EXIF/PNG images. A picture taken by a digital camera can contain, for example, the following tags:

TagCodeTagCode
ImageWidth0x100ImageHeight0x101
EquipMake0x10fEquipModel0x110
Orientation0x112XResolution0x11a
YResolution0x11bResolutionUnit0x128
SoftwareUsed0x131DateTime0x132
YCbCrPositioning0x213ExifExposureTime0x829a
ExifFNumber0x829dExifExposureProg0x8822
ExifISOSpeed0x8827ExifVer0x9000
ExifDTOrig0x9003ExifDTDigitized0x9004
ExifCompConfig0x9101ExifShutterSpeed0x9201
ExifAperture0x9202ExifBrightness0x9203
ExifExposureBias0x9204ExifMaxAperture0x9205
ExifSubjectDist0x9206ExifMeteringMode0x9207
ExifFlash0x9209ExifFocalLength0x920a
ExifMakerNote0x927cExifDTSubsec0x9290
ExifDTOrigSS0x9291ExifDTDigSS0x9292
ExifFPXVer0xa000ExifColorSpace0xa001
ExifPixXDim0xa002ExifPixYDim0xa003
ExifSensingMethod0xa217ExifSceneType0xa301
GpsVer0x0GpsLatitudeRef0x1
GpsLatitude0x2GpsLongitudeRef0x3
GpsLongitude0x4GpsAltitudeRef0x5
GpsAltitude0x6GpsGpsTime0x7
GpsGpsDop0xbThumbnailData0x501b
ThumbnailImageWidth0x5020ThumbnailImageHeight0x5021
ThumbnailCompression0x5023ThumbnailOrientation0x5029
ThumbnailResolutionX0x502dThumbnailResolutionY0x502e
ThumbnailResolutionUnit0x5030JPEGInterFormat0x201
JPEGInterLength0x202ChrominanceTable0x5091
LuminanceTable0x5090ICCProfile0x8773

For the full list of possible tags, please use any internet search engine and search for the official specification of image/picture metadata tags.