geotiff.js
    Preparing search index...

    Class ImageFileDirectory

    Constructors

    • Create an ImageFileDirectory.

      Parameters

      • actualizedFields: Map<string | number, string | number | (string | number)[]>

        the file directory, mapping tag names to values

      • deferredFields: Map<string | number, Function>

        the deferred fields, mapping tag names to async functions

      • deferredArrays: Map<string | number, DeferredArray>

        the deferred arrays, mapping tag names to DeferredArray objects

      • nextIFDByteOffset: number

        the byte offset to the next IFD

      Returns ImageFileDirectory

    Properties

    actualizedFields: Map<string | number, string | number | (string | number)[]>
    deferredArrays: Map<string | number, DeferredArray>
    deferredFields: Map<string | number, Function>
    deferredFieldsBeingResolved: Map<any, any>
    nextIFDByteOffset: number

    Methods

    • Synchronously retrieves the value for a given tag. If it is deferred, an error is thrown.

      Type Parameters

      • T extends
            | "NewSubfileType"
            | "SubfileType"
            | "ImageWidth"
            | "ImageLength"
            | "BitsPerSample"
            | "Compression"
            | "PhotometricInterpretation"
            | "Threshholding"
            | "CellWidth"
            | "CellLength"
            | "FillOrder"
            | "DocumentName"
            | "ImageDescription"
            | "Make"
            | "Model"
            | "StripOffsets"
            | "Orientation"
            | "SamplesPerPixel"
            | "RowsPerStrip"
            | "StripByteCounts"
            | "MinSampleValue"
            | "MaxSampleValue"
            | "XResolution"
            | "YResolution"
            | "PlanarConfiguration"
            | "PageName"
            | "XPosition"
            | "YPosition"
            | "FreeOffsets"
            | "FreeByteCounts"
            | "GrayResponseUnit"
            | "GrayResponseCurve"
            | "T4Options"
            | "T6Options"
            | "ResolutionUnit"
            | "PageNumber"
            | "TransferFunction"
            | "Software"
            | "DateTime"
            | "Artist"
            | "HostComputer"
            | "Predictor"
            | "WhitePoint"
            | "PrimaryChromaticities"
            | "ColorMap"
            | "HalftoneHints"
            | "TileWidth"
            | "TileLength"
            | "TileOffsets"
            | "TileByteCounts"
            | "InkSet"
            | "InkNames"
            | "NumberOfInks"
            | "DotRange"
            | "TargetPrinter"
            | "ExtraSamples"
            | "SampleFormat"
            | "SMinSampleValue"
            | "SMaxSampleValue"
            | "TransferRange"
            | "JPEGProc"
            | "JPEGInterchangeFormat"
            | "JPEGInterchangeFormatLngth"
            | "JPEGRestartInterval"
            | "JPEGLosslessPredictors"
            | "JPEGPointTransforms"
            | "JPEGQTables"
            | "JPEGDCTables"
            | "JPEGACTables"
            | "YCbCrCoefficients"
            | "YCbCrSubSampling"
            | "YCbCrPositioning"
            | "ReferenceBlackWhite"
            | "Copyright"
            | "BadFaxLines"
            | "CleanFaxData"
            | "ClipPath"
            | "ConsecutiveBadFaxLines"
            | "Decode"
            | "DefaultImageColor"
            | "Indexed"
            | "JPEGTables"
            | "StripRowCounts"
            | "SubIFDs"
            | "XClipPathUnits"
            | "YClipPathUnits"
            | "ApertureValue"
            | "ColorSpace"
            | "DateTimeDigitized"
            | "DateTimeOriginal"
            | "ExifIFD"
            | "ExifVersion"
            | "ExposureTime"
            | "FileSource"
            | "Flash"
            | "FlashpixVersion"
            | "FNumber"
            | "ImageUniqueID"
            | "LightSource"
            | "MakerNote"
            | "ShutterSpeedValue"
            | "UserComment"
            | "IPTC"
            | "CZ_LSMINFO"
            | "ICCProfile"
            | "XMP"
            | "GDAL_METADATA"
            | "GDAL_NODATA"
            | "Photoshop"
            | "ModelPixelScale"
            | "ModelTiepoint"
            | "ModelTransformation"
            | "GeoKeyDirectory"
            | "GeoDoubleParams"
            | "GeoAsciiParams"
            | "LercParameters" = any

      Parameters

      • tagIdentifier: number | T

        The field tag ID or name

      Returns T extends | "NewSubfileType"
      | "SubfileType"
      | "ImageWidth"
      | "ImageLength"
      | "BitsPerSample"
      | "Compression"
      | "PhotometricInterpretation"
      | "Threshholding"
      | "CellWidth"
      | "CellLength"
      | "FillOrder"
      | "DocumentName"
      | "ImageDescription"
      | "Make"
      | "Model"
      | "StripOffsets"
      | "Orientation"
      | "SamplesPerPixel"
      | "RowsPerStrip"
      | "StripByteCounts"
      | "MinSampleValue"
      | "MaxSampleValue"
      | "XResolution"
      | "YResolution"
      | "PlanarConfiguration"
      | "PageName"
      | "XPosition"
      | "YPosition"
      | "FreeOffsets"
      | "FreeByteCounts"
      | "GrayResponseUnit"
      | "GrayResponseCurve"
      | "T4Options"
      | "T6Options"
      | "ResolutionUnit"
      | "PageNumber"
      | "TransferFunction"
      | "Software"
      | "DateTime"
      | "Artist"
      | "HostComputer"
      | "Predictor"
      | "WhitePoint"
      | "PrimaryChromaticities"
      | "ColorMap"
      | "HalftoneHints"
      | "TileWidth"
      | "TileLength"
      | "TileOffsets"
      | "TileByteCounts"
      | "InkSet"
      | "InkNames"
      | "NumberOfInks"
      | "DotRange"
      | "TargetPrinter"
      | "ExtraSamples"
      | "SampleFormat"
      | "SMinSampleValue"
      | "SMaxSampleValue"
      | "TransferRange"
      | "JPEGProc"
      | "JPEGInterchangeFormat"
      | "JPEGInterchangeFormatLngth"
      | "JPEGRestartInterval"
      | "JPEGLosslessPredictors"
      | "JPEGPointTransforms"
      | "JPEGQTables"
      | "JPEGDCTables"
      | "JPEGACTables"
      | "YCbCrCoefficients"
      | "YCbCrSubSampling"
      | "YCbCrPositioning"
      | "ReferenceBlackWhite"
      | "Copyright"
      | "BadFaxLines"
      | "CleanFaxData"
      | "ClipPath"
      | "ConsecutiveBadFaxLines"
      | "Decode"
      | "DefaultImageColor"
      | "Indexed"
      | "JPEGTables"
      | "StripRowCounts"
      | "SubIFDs"
      | "XClipPathUnits"
      | "YClipPathUnits"
      | "ApertureValue"
      | "ColorSpace"
      | "DateTimeDigitized"
      | "DateTimeOriginal"
      | "ExifIFD"
      | "ExifVersion"
      | "ExposureTime"
      | "FileSource"
      | "Flash"
      | "FlashpixVersion"
      | "FNumber"
      | "ImageUniqueID"
      | "LightSource"
      | "MakerNote"
      | "ShutterSpeedValue"
      | "UserComment"
      | "IPTC"
      | "CZ_LSMINFO"
      | "ICCProfile"
      | "XMP"
      | "GDAL_METADATA"
      | "GDAL_NODATA"
      | "Photoshop"
      | "ModelPixelScale"
      | "ModelTiepoint"
      | "ModelTransformation"
      | "GeoKeyDirectory"
      | "GeoDoubleParams"
      | "GeoAsciiParams"
      | "LercParameters"
          ? TagValue<T<T>>
          | undefined
          : unknown

      the field value, or undefined if it does not exist

      If the tag is deferred and requires asynchronous loading

    • Type Parameters

      • T extends
            | "NewSubfileType"
            | "SubfileType"
            | "ImageWidth"
            | "ImageLength"
            | "BitsPerSample"
            | "Compression"
            | "PhotometricInterpretation"
            | "Threshholding"
            | "CellWidth"
            | "CellLength"
            | "FillOrder"
            | "DocumentName"
            | "ImageDescription"
            | "Make"
            | "Model"
            | "StripOffsets"
            | "Orientation"
            | "SamplesPerPixel"
            | "RowsPerStrip"
            | "StripByteCounts"
            | "MinSampleValue"
            | "MaxSampleValue"
            | "XResolution"
            | "YResolution"
            | "PlanarConfiguration"
            | "PageName"
            | "XPosition"
            | "YPosition"
            | "FreeOffsets"
            | "FreeByteCounts"
            | "GrayResponseUnit"
            | "GrayResponseCurve"
            | "T4Options"
            | "T6Options"
            | "ResolutionUnit"
            | "PageNumber"
            | "TransferFunction"
            | "Software"
            | "DateTime"
            | "Artist"
            | "HostComputer"
            | "Predictor"
            | "WhitePoint"
            | "PrimaryChromaticities"
            | "ColorMap"
            | "HalftoneHints"
            | "TileWidth"
            | "TileLength"
            | "TileOffsets"
            | "TileByteCounts"
            | "InkSet"
            | "InkNames"
            | "NumberOfInks"
            | "DotRange"
            | "TargetPrinter"
            | "ExtraSamples"
            | "SampleFormat"
            | "SMinSampleValue"
            | "SMaxSampleValue"
            | "TransferRange"
            | "JPEGProc"
            | "JPEGInterchangeFormat"
            | "JPEGInterchangeFormatLngth"
            | "JPEGRestartInterval"
            | "JPEGLosslessPredictors"
            | "JPEGPointTransforms"
            | "JPEGQTables"
            | "JPEGDCTables"
            | "JPEGACTables"
            | "YCbCrCoefficients"
            | "YCbCrSubSampling"
            | "YCbCrPositioning"
            | "ReferenceBlackWhite"
            | "Copyright"
            | "BadFaxLines"
            | "CleanFaxData"
            | "ClipPath"
            | "ConsecutiveBadFaxLines"
            | "Decode"
            | "DefaultImageColor"
            | "Indexed"
            | "JPEGTables"
            | "StripRowCounts"
            | "SubIFDs"
            | "XClipPathUnits"
            | "YClipPathUnits"
            | "ApertureValue"
            | "ColorSpace"
            | "DateTimeDigitized"
            | "DateTimeOriginal"
            | "ExifIFD"
            | "ExifVersion"
            | "ExposureTime"
            | "FileSource"
            | "Flash"
            | "FlashpixVersion"
            | "FNumber"
            | "ImageUniqueID"
            | "LightSource"
            | "MakerNote"
            | "ShutterSpeedValue"
            | "UserComment"
            | "IPTC"
            | "CZ_LSMINFO"
            | "ICCProfile"
            | "XMP"
            | "GDAL_METADATA"
            | "GDAL_NODATA"
            | "Photoshop"
            | "ModelPixelScale"
            | "ModelTiepoint"
            | "ModelTransformation"
            | "GeoKeyDirectory"
            | "GeoDoubleParams"
            | "GeoAsciiParams"
            | "LercParameters" = any

      Parameters

      • tagIdentifier: number | T

        The field tag ID or name

      Returns this is { getValue(t: T): NonNullable<TagValue<T>> } & ImageFileDirectory

      whether the field exists (actualized or deferred)

    • Retrieves the value for a given tag. If it is deferred, it will be loaded first.

      Type Parameters

      • T extends
            | "NewSubfileType"
            | "SubfileType"
            | "ImageWidth"
            | "ImageLength"
            | "BitsPerSample"
            | "Compression"
            | "PhotometricInterpretation"
            | "Threshholding"
            | "CellWidth"
            | "CellLength"
            | "FillOrder"
            | "DocumentName"
            | "ImageDescription"
            | "Make"
            | "Model"
            | "StripOffsets"
            | "Orientation"
            | "SamplesPerPixel"
            | "RowsPerStrip"
            | "StripByteCounts"
            | "MinSampleValue"
            | "MaxSampleValue"
            | "XResolution"
            | "YResolution"
            | "PlanarConfiguration"
            | "PageName"
            | "XPosition"
            | "YPosition"
            | "FreeOffsets"
            | "FreeByteCounts"
            | "GrayResponseUnit"
            | "GrayResponseCurve"
            | "T4Options"
            | "T6Options"
            | "ResolutionUnit"
            | "PageNumber"
            | "TransferFunction"
            | "Software"
            | "DateTime"
            | "Artist"
            | "HostComputer"
            | "Predictor"
            | "WhitePoint"
            | "PrimaryChromaticities"
            | "ColorMap"
            | "HalftoneHints"
            | "TileWidth"
            | "TileLength"
            | "TileOffsets"
            | "TileByteCounts"
            | "InkSet"
            | "InkNames"
            | "NumberOfInks"
            | "DotRange"
            | "TargetPrinter"
            | "ExtraSamples"
            | "SampleFormat"
            | "SMinSampleValue"
            | "SMaxSampleValue"
            | "TransferRange"
            | "JPEGProc"
            | "JPEGInterchangeFormat"
            | "JPEGInterchangeFormatLngth"
            | "JPEGRestartInterval"
            | "JPEGLosslessPredictors"
            | "JPEGPointTransforms"
            | "JPEGQTables"
            | "JPEGDCTables"
            | "JPEGACTables"
            | "YCbCrCoefficients"
            | "YCbCrSubSampling"
            | "YCbCrPositioning"
            | "ReferenceBlackWhite"
            | "Copyright"
            | "BadFaxLines"
            | "CleanFaxData"
            | "ClipPath"
            | "ConsecutiveBadFaxLines"
            | "Decode"
            | "DefaultImageColor"
            | "Indexed"
            | "JPEGTables"
            | "StripRowCounts"
            | "SubIFDs"
            | "XClipPathUnits"
            | "YClipPathUnits"
            | "ApertureValue"
            | "ColorSpace"
            | "DateTimeDigitized"
            | "DateTimeOriginal"
            | "ExifIFD"
            | "ExifVersion"
            | "ExposureTime"
            | "FileSource"
            | "Flash"
            | "FlashpixVersion"
            | "FNumber"
            | "ImageUniqueID"
            | "LightSource"
            | "MakerNote"
            | "ShutterSpeedValue"
            | "UserComment"
            | "IPTC"
            | "CZ_LSMINFO"
            | "ICCProfile"
            | "XMP"
            | "GDAL_METADATA"
            | "GDAL_NODATA"
            | "Photoshop"
            | "ModelPixelScale"
            | "ModelTiepoint"
            | "ModelTransformation"
            | "GeoKeyDirectory"
            | "GeoDoubleParams"
            | "GeoAsciiParams"
            | "LercParameters" = any

      Parameters

      • tagIdentifier: number | T

        The field tag ID or name

      Returns Promise<
          T extends | "NewSubfileType"
          | "SubfileType"
          | "ImageWidth"
          | "ImageLength"
          | "BitsPerSample"
          | "Compression"
          | "PhotometricInterpretation"
          | "Threshholding"
          | "CellWidth"
          | "CellLength"
          | "FillOrder"
          | "DocumentName"
          | "ImageDescription"
          | "Make"
          | "Model"
          | "StripOffsets"
          | "Orientation"
          | "SamplesPerPixel"
          | "RowsPerStrip"
          | "StripByteCounts"
          | "MinSampleValue"
          | "MaxSampleValue"
          | "XResolution"
          | "YResolution"
          | "PlanarConfiguration"
          | "PageName"
          | "XPosition"
          | "YPosition"
          | "FreeOffsets"
          | "FreeByteCounts"
          | "GrayResponseUnit"
          | "GrayResponseCurve"
          | "T4Options"
          | "T6Options"
          | "ResolutionUnit"
          | "PageNumber"
          | "TransferFunction"
          | "Software"
          | "DateTime"
          | "Artist"
          | "HostComputer"
          | "Predictor"
          | "WhitePoint"
          | "PrimaryChromaticities"
          | "ColorMap"
          | "HalftoneHints"
          | "TileWidth"
          | "TileLength"
          | "TileOffsets"
          | "TileByteCounts"
          | "InkSet"
          | "InkNames"
          | "NumberOfInks"
          | "DotRange"
          | "TargetPrinter"
          | "ExtraSamples"
          | "SampleFormat"
          | "SMinSampleValue"
          | "SMaxSampleValue"
          | "TransferRange"
          | "JPEGProc"
          | "JPEGInterchangeFormat"
          | "JPEGInterchangeFormatLngth"
          | "JPEGRestartInterval"
          | "JPEGLosslessPredictors"
          | "JPEGPointTransforms"
          | "JPEGQTables"
          | "JPEGDCTables"
          | "JPEGACTables"
          | "YCbCrCoefficients"
          | "YCbCrSubSampling"
          | "YCbCrPositioning"
          | "ReferenceBlackWhite"
          | "Copyright"
          | "BadFaxLines"
          | "CleanFaxData"
          | "ClipPath"
          | "ConsecutiveBadFaxLines"
          | "Decode"
          | "DefaultImageColor"
          | "Indexed"
          | "JPEGTables"
          | "StripRowCounts"
          | "SubIFDs"
          | "XClipPathUnits"
          | "YClipPathUnits"
          | "ApertureValue"
          | "ColorSpace"
          | "DateTimeDigitized"
          | "DateTimeOriginal"
          | "ExifIFD"
          | "ExifVersion"
          | "ExposureTime"
          | "FileSource"
          | "Flash"
          | "FlashpixVersion"
          | "FNumber"
          | "ImageUniqueID"
          | "LightSource"
          | "MakerNote"
          | "ShutterSpeedValue"
          | "UserComment"
          | "IPTC"
          | "CZ_LSMINFO"
          | "ICCProfile"
          | "XMP"
          | "GDAL_METADATA"
          | "GDAL_NODATA"
          | "Photoshop"
          | "ModelPixelScale"
          | "ModelTiepoint"
          | "ModelTransformation"
          | "GeoKeyDirectory"
          | "GeoDoubleParams"
          | "GeoAsciiParams"
          | "LercParameters"
              ? TagValue<T<T>>
              | undefined
              : any,
      >

      the field value, or undefined if it does not exist

    • Retrieves the value at a given index for a tag that is an array. If it is deferred, it will be loaded first.

      Parameters

      • tagIdentifier: string | number

        The field tag ID or name

      • index: number

        The index within the array

      Returns Promise<string | number | bigint | undefined>

      the field value at the given index, or undefined if it does not exist

    • Parses the GeoTIFF GeoKeyDirectory tag into a structured object. The GeoKeyDirectory is a special TIFF tag that contains geographic metadata in a key-value format as defined by the GeoTIFF specification.

      Returns Partial<Record<GeoKeyName, any>> | null

      Parsed geo key directory mapping key names to values, or null if not present

      If a referenced geo key value cannot be retrieved