Skip to main content

Built and signed on GitHub Actions

Library to help probing media files for metadata.

This package works with Node.jsIt is unknown whether this package works with Bun, Cloudflare Workers, Deno, Browsers
JSR Score
64%
Published
4 weeks ago (0.0.6)
class ExiftoolService

Constructors

new
ExiftoolService(config: ExiftoolServiceConfig)

Methods

exiftool(unnamed 0: { args: string[]; path: string; options: { override: boolean; ignoreMinorErrors: boolean; }; }): Promise<string>
extractDateTimeFromExif(unnamed 0: { metadata: ExiftoolMetadata; timeZone?: string; fileTimeFallback: boolean; }): { source: string; raw: string; iso: string; } | null

Returns the time of capture from the exif metadata provided

extractExifMetadata(path: string): Promise<ExiftoolMetadata>

Returns the exif metadata stored on the file provided

extractGpsExifMetadata(path: string): Promise<{ latitude: number; longitude: number; } | null>
extractLivePhotoSourceUuidFromExif(unnamed 0: { metadata: ExiftoolMetadata; }): string | null

Returns the UUID of the live photo source from the exif metadata of the photo provided

extractLivePhotoTargetUuidFromExif(unnamed 0: { metadata: ExiftoolMetadata; }): string | null

Returns the UUID of the live photo target from the exif metadata of the video provided

extractTimeExifMetadata(path: string): Promise<ExiftoolMetadata>

Returns the time related exif metadata stored on the file provided

private
parseDateTime(unnamed 0: { date: string; fallbackTimeZone?: string; }): DateTime | null
private
rawExiftool(command: string): Promise<string>
setAllTime(path: string, time: string, options: { file: boolean; override: boolean; ignoreMinorErrors: boolean; }): Promise<void>

Sets all the times to the provided time. Can also change the file attributes to be in sync.

setQuickTimeCreationDate(path: string, time: string, options: { override: boolean; ignoreMinorErrors: boolean; }): Promise<void>
setTimezoneOffsets(path: string, offset: string, options: { override: boolean; ignoreMinorErrors: boolean; }): Promise<void>

Sets the time zone offset in the exif data (for photos)

Add Package

deno add @hwaterke/media-probe

Import symbol

import { ExiftoolService } from "@hwaterke/media-probe";

Add Package

npx jsr add @hwaterke/media-probe

Import symbol

import { ExiftoolService } from "@hwaterke/media-probe";

Add Package

yarn dlx jsr add @hwaterke/media-probe

Import symbol

import { ExiftoolService } from "@hwaterke/media-probe";

Add Package

pnpm dlx jsr add @hwaterke/media-probe

Import symbol

import { ExiftoolService } from "@hwaterke/media-probe";

Add Package

bunx jsr add @hwaterke/media-probe

Import symbol

import { ExiftoolService } from "@hwaterke/media-probe";