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)

116 lines (115 loc) 3.95 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. */ export declare class ExifData extends IfdContainer { /** * Get the image IFD directory. * @returns {IfdDirectory} The image IFD directory. */ get imageIfd(): IfdDirectory; /** * Get the thumbnail IFD directory. * @returns {IfdDirectory} The thumbnail IFD directory. */ get thumbnailIfd(): IfdDirectory; /** * Get the Exif IFD directory. * @returns {IfdDirectory} The Exif IFD directory. */ get exifIfd(): IfdDirectory; /** * Get the GPS IFD directory. * @returns {IfdDirectory} The GPS IFD directory. */ get gpsIfd(): IfdDirectory; /** * Get the interoperability IFD directory. * @returns {IfdDirectory} The interoperability IFD directory. */ get interopIfd(): IfdDirectory; /** * Get the total data size. * @returns {number} The total data size. */ get dataSize(): number; /** * Write the IFD directory to the output buffer. * @param {OutputBuffer} out - The output buffer. * @param {IfdDirectory} ifd - The IFD directory. * @param {number} dataOffset - The data offset. * @returns {number} The new data offset. */ private writeDirectory; /** * Write large values of the IFD directory to the output buffer. * @param {OutputBuffer} out - The output buffer. * @param {IfdDirectory} ifd - The IFD directory. */ private writeDirectoryLargeValues; /** * Read an Exif entry from the input buffer. * @param {InputBuffer<Uint8Array>} block - The input buffer. * @param {number} blockOffset - The block offset. * @returns {ExifEntry} The Exif entry. */ private readEntry; /** * Create an ExifData instance from another ExifData instance. * @param {ExifData} other - The other ExifData instance. * @returns {ExifData} The new ExifData instance. */ static from(other: ExifData): ExifData; /** * Create an ExifData instance from an input buffer. * @param {InputBuffer<Uint8Array>} input - The input buffer. * @returns {ExifData} The new ExifData instance. */ static fromInputBuffer(input: InputBuffer<Uint8Array>): ExifData; /** * Check if a tag exists in the Exif data. * @param {number} tag - The tag number. * @returns {boolean} True if the tag exists, false otherwise. */ hasTag(tag: number): boolean; /** * Get the value of a tag. * @param {number} tag - The tag number. * @returns {IfdValue | undefined} The value of the tag, or undefined if not found. */ getTag(tag: number): IfdValue | undefined; /** * Get the name of a tag. * @param {number} tag - The tag number. * @returns {string} The name of the tag. */ getTagName(tag: number): string; /** * Write the Exif data to the output buffer. * @param {OutputBuffer} out - The output buffer. */ write(out: OutputBuffer): void; /** * Read the Exif data from the input buffer. * @param {InputBuffer<Uint8Array>} block - The input buffer. * @returns {boolean} True if the read was successful, false otherwise. */ read(block: InputBuffer<Uint8Array>): boolean; /** * Creates and returns a clone of the current ExifData object. * * @returns {ExifData} a new ExifData object that is a copy of the current instance. */ clone(): ExifData; /** * Converts the directory structure into a string representation. * * @returns {string} A string representation of the directory structure. */ toString(): string; }