UNPKG

image-in-browser

Version:

Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)

96 lines (95 loc) 3.28 kB
/** @format */ import { InputBuffer } from '../common/input-buffer.js'; import { OutputBuffer } from '../common/output-buffer.js'; import { IfdContainer } from './ifd-container.js'; import { IfdDirectory } from './ifd-directory.js'; import { IfdValue } from './ifd-value/ifd-value.js'; /** * Class representing ExifData and providing methods for reading, writing, and manipulating Exif metadata. */ export declare class ExifData extends IfdContainer { /** Returns the image IFD directory. */ get imageIfd(): IfdDirectory; /** Returns the thumbnail IFD directory. */ get thumbnailIfd(): IfdDirectory; /** Returns the Exif IFD directory. */ get exifIfd(): IfdDirectory; /** Returns the GPS IFD directory. */ get gpsIfd(): IfdDirectory; /** Returns the interoperability IFD directory. */ get interopIfd(): IfdDirectory; /** Returns the total data size. */ get dataSize(): number; /** * Checks if a tag exists in any directory. * @param tag Tag number to check. * @returns True if the tag exists, false otherwise. */ hasTag(tag: number): boolean; /** * Gets the value of a tag. * @param tag Tag number to get. * @returns Value of the tag, or undefined if not found. */ getTag(tag: number): IfdValue | undefined; /** * Gets the name of a tag. * @param tag Tag number. * @returns Name of the tag. */ getTagName(tag: number): string; /** * Writes Exif data to the output buffer. * @param out Output buffer to write to. */ write(out: OutputBuffer): void; /** * Reads Exif data from the input buffer. * @param block Input buffer to read from. * @returns True if read was successful, false otherwise. */ read(block: InputBuffer<Uint8Array>): boolean; /** * Creates a clone of the current ExifData object. * @returns A new ExifData object that is a copy of the current instance. */ clone(): ExifData; /** * Converts the directory structure into a string representation. * @returns String representation of the directory structure. */ toString(): string; /** * Creates an ExifData instance from another ExifData instance. * @param other Source ExifData instance. * @returns New ExifData instance. */ static from(other: ExifData): ExifData; /** * Creates an ExifData instance from an input buffer. * @param input Input buffer to read from. * @returns New ExifData instance. */ static fromInputBuffer(input: InputBuffer<Uint8Array>): ExifData; /** * Writes the IFD directory to the output buffer. * @param out Output buffer. * @param ifd IFD directory to write. * @param dataOffset Offset for data values. * @returns New data offset after writing. */ private writeDirectory; /** * Writes large values of the IFD directory to the output buffer. * @param out Output buffer. * @param ifd IFD directory. */ private writeDirectoryLargeValues; /** * Reads an Exif entry from the input buffer. * @param block Input buffer. * @param blockOffset Offset in the buffer. * @returns ExifEntry object. */ private readEntry; }