GS-Base Help > Using fileStats() Functions to Obtain EXIF Tags and Metadata from Multimedia Files

fileStats(filePath, type)

This function returns:

  1. EXIF tags for files representing photos (saved by digital cameras) and any other JPG/TIFF/PNG/BMP/ICO images.
  2. Various multimedia-related metadata for multimedia (video/sound) files.

filePath

A textual field containing full file paths (or a directly entered fixed string). File paths from a given folder or entire disk partitions can be loaded with the "Tools > Verify Files" functions.

type

A numeric code representing one of two types of extracted tags, depending on the file type:
if the path points to a photo or other JPG/TIFF/PNG/BMP/ICO image, this code represents an extracted EXIF tag;
if the path points to a multimedia video or sound file, this code represents multimedia file metadata.

NOTE: this function should be used in calculated Text fields.
For best performance for very large tables that you update at once, increase the number of processor cores used for calculations in the Settings > Options > General window.

=fileStats(images, 1)    returns the GPS latitude for the location where the image was taken
=fileStats("e:\photo3.jpg", 6)    returns the GPS altitude for the location where the image was taken
=fileStats(images, hex2dec("132"))    returns the 0x132 property value (a date) for a given image
=fileStats(images, -1)    returns the list of all EXIF tags encoded in a given image
=fileStats(videos, 3)
=fileStats("e:\some_file.avi", 3)
=fileStats(videos, 20)
=fileStats(videos, 11)

EXIF Property Codes

EXIF property value (hexadecimal) codes for photos and other JPG/TIFF/EXIF/PNG/BMP/ICO images:

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

Multimedia Metadata Codes

Multimedia metadata tag codes for video/sound files:

CodeDescription
1Digital Living Network Alliance(DLNA) profile identifier.
2Number of audio channels.
3Average audio bit rate, in bits per second.
4Audio subtype.
5Indicates whether the audio stream uses variable bit-rate encoding.
6Peak volume level of audio content.
7Audio sample rate in samples per second.
8Number of bits per audio sample.
9Identifier of the audio stream.
10Author.
11A comment attached to a file.
12Copyright information.
13Indicates whether the content is protected using digital rights management.
14Keywords.
15Language.
16URL of the author's website.
17Average volume level of audio content.
18The string representation of a GUID that identifies the primary class of media.
19The string representation of a GUID that identifies the secondary class of media.
20The string representation of a GUID that identifies the collection group.
21The string representation of a GUID that identifies the collection.
22Distributor of the content.
23The string representation of a GUID that identifies the collection.
24Time when the content was encoded.
25Original release date.
26Duration, in 100-nanosecond units.
27Digital video disc identifier.
28Name of the person or group that encoded the content.
29Description of the settings used to encode the content.
30Music CD identifier. This value is used to identify a CD.
31Name of the metadata content provider.
32Name of the producer of the content.
33URL of a website offering a promotion related to the content.
34Rating of the content as assigned by the metadata content provider.
35Style or genre of the content as assigned by the metadata content provider.
36Publisher.
37Subtitle.
38A generic string that can be used to identify the file.
39Writer.
40Year the content was published.
41Primary artist for the album.
42Album title.
43Artist.
44Beats per minute.
45Composer.
46Conductor.
47Description of the content (boxed set or series).
48Genre.
49The initial key of the music.
50Indicates whether the music file is part of a compilation.
51Lyrics.
52Mood.
53The part number and the total number of parts.
54Period.
55Track number.
56Parental rating.
57Reasons for the assigned parental rating.
58User rating.
59Thumbnail image.
60Title.
61Video subtype.
62Director.
63Average video bit rate, in bits per second.
64The FOURCC of the video encoding format.
65Video frame height.
66Video frame rate, expressed as frames per second × 1000.
67Video frame width.
68The horizontal component of the pixel aspect ratio.
69Indicates whether the video stream contains stereo video content.
70Identifier of the video stream.
71Total data rate for all video and audio streams, in bits per second.