Tane H. 판매

A lightweight JavaScript library for reading EXIF and IPTC metadata from JPEG and TIFF images in the browser, supporting AMD, CommonJS, and global script environments.
This block provides the exif-js library (v2.3.0), which reads EXIF and IPTC metadata embedded in JPEG and TIFF image files. It works in browser environments with <img> elements and file inputs, and in Node.js/AMD/CommonJS environments. Typical buyers are web developers who need to extract camera metadata (orientation, GPS, exposure, make/model) from user-uploaded images.
exif.js - Core library implementing the EXIF parser; exposes the global EXIF object and CommonJS/AMD exportsexif.d.ts - TypeScript type declarations for the EXIF static interfaceindex.html - Browser demo showing basic usage patternspackage.json - NPM package manifestbower.json - Bower manifest (legacy)CHANGELOG.md - Version historyLICENSE.md - MIT license textREADME.md - Upstream documentationexample/ - Sample images (JPEG) and a standalone HTML demonpm install user@example.com
exif-js has no runtime dependencies. No native build steps, no pod install, no Android linking required. For TypeScript projects the type declarations are bundled in exif.d.ts.
Copy the source/ directory into your project, e.g. vendor/exif-js/.
For a Node.js / TypeScript project, require or import directly:
// tsconfig.json — ensure paths include the vendor directory if using local copy
{
"compilerOptions": {
"paths": {
"exif-js": ["./vendor/exif-js/exif.js"]
},
"typeRoots": ["./vendor/exif-js"]
}
}
If using the npm package instead of the local copy, npm install user@example.com and import as shown in the API section.
For browser bundler projects (webpack, vite), the library auto-detects CommonJS vs global and works without additional configuration.
No environment variables are required.
For XMP data extraction (optional), call EXIF.enableXmp() before any getData call — this is not enabled by default to avoid performance cost.
격리된 샌드박스를 띄워 서버에서 바로 실행하세요 — 로컬 설정 불필요.
이 버전에 대한 Tetrees AI Review
This JavaScript library / package completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
파이프라인 avcp-2026-08-04.1 · SHA-256 081ffd28fffa9529…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
검토일 2026년 8월 4일
이 제품을 AI IDE, 웹 빌더 또는 클라우드 IDE로 바로 가져오세요.
Tetrees를 호환 AI IDE에 연결해 보유 제품을 불러오고, 판매자 업로드 권한을 노출하지 않은 채 검증된 ZIP을 받으세요.
아직 리뷰가 없습니다.
토론을 불러오는 중…
getData(img: HTMLImageElement | File, callback: () => void): any;
Reads EXIF data from an image element or a File object from a file input. The callback is invoked after parsing; inside the callback, this refers to the image/file and has an exifdata property attached. Must be called after the image has fully loaded.
getTag(img: any, tag: string): any;
Returns the value of a single named EXIF tag from an image that has already been processed by getData. Pass the tag string name (e.g. "Make", "Model", "Orientation", "GPSLatitude"). Returns undefined if the tag is absent.
getAllTags(img: any): { [tagName: string]: any };
Returns a plain object containing all EXIF tags found in the image after getData has run. Useful for debugging or displaying a full metadata dump.
pretty(img: any): string;
Returns a human-readable, newline-separated string of all EXIF tags and their values for the image. Convenient for logging or displaying metadata in a <pre> block.
readFromBinaryFile(file: any): any;
Low-level method that parses EXIF data directly from a binary file buffer. Useful in Node.js when reading image files from disk without a DOM.
The image must be fully loaded before getData is called. Use window.onload or the image's own onload handler to guarantee this.
import * as EXIF from 'exif-js';
window.onload = function () {
const img = document.getElementById('photo') as HTMLImageElement;
EXIF.getData(img, function (this: HTMLImageElement) {
const make: string = EXIF.getTag(this, 'Make');
const model: string = EXIF.getTag(this, 'Model');
console.log(`Camera: ${make} ${model}`);
});
};
When a user selects a file, pass the File object directly to getData. No image element is needed.
import * as EXIF from 'exif-js';
const input = document.getElementById('fileInput') as HTMLInputElement;
input.addEventListener('change', () => {
const file = input.files?.[0];
if (!file) return;
EXIF.getData(file as any, function (this: any) {
const allTags = EXIF.getAllTags(this);
console.log('All EXIF tags:', JSON.stringify(allTags, null, 2));
const orientation: number = EXIF.getTag(this, 'Orientation');
console.log('Orientation:', orientation);
});
});
Use EXIF.pretty to get a formatted string suitable for display without manual serialization.
import * as EXIF from 'exif-js';
function displayExif(img: HTMLImageElement, containerId: string): void {
EXIF.getData(img, function (this: HTMLImageElement) {
const output = document.getElementById(containerId);
if (output) {
output.textContent = EXIF.pretty(this);
}
});
}
window.onload = () => {
const img = document.getElementById('img2') as HTMLImageElement;
displayExif(img, 'exifOutput');
};
In a Node.js context, read the file buffer and pass it to readFromBinaryFile directly.
import * as fs from 'fs';
import * as EXIF from 'exif-js';
const buffer = fs.readFileSync('./photo.jpg');
const arrayBuffer = buffer.buffer.slice(
buffer.byteOffset,
buffer.byteOffset + buffer.byteLength
) as ArrayBuffer;
const tags = EXIF.readFromBinaryFile(arrayBuffer);
console.log('Parsed tags:', tags);
exif.js - The entire library implementation. Defines EXIF, EXIF.Tags, EXIF.TiffTags, EXIF.GPSTags, and all parsing logic. Entry point for both browser and Node.js. Exports EXIF as the CommonJS module export.exif.d.ts - TypeScript interface EXIFStatic describing getData, getTag, getAllTags, pretty, and readFromBinaryFile. Drop alongside exif.js so TypeScript resolves types.index.html - Browser-only interactive demo; not needed in production but useful as a reference for event wiring.package.json - Declares "main": "exif.js" and package metadata. Used by npm/Node module resolution.bower.json - Legacy Bower manifest; ignore in modern projects.CHANGELOG.md - Documents breaking changes between versions; consult when upgrading.LICENSE.md - MIT license; must be retained in distributions.README.md - Upstream usage documentation and tag reference.example/ - Sample JPEG images used by the HTML demo. No production relevance.getData before image load completes: The call silently fails and exifdata is empty. Fix: always invoke inside window.onload or the image's onload callback, never in DOMContentLoaded.$(document).ready() fires before images load: Do not use it to gate EXIF calls. Fix: use $(window).load() or native window.onload.this context inside callback is any: The callback uses this (not a parameter) to reference the image. Fix: annotate the function with function(this: HTMLImageElement) to satisfy strict TypeScript.getData skips XMP by default. Fix: call EXIF.enableXmp() once before any getData call.exif-js uses CommonJS module.exports = EXIF. Fix: use import * as EXIF from 'exif-js' or const EXIF = require('exif-js'), not import EXIF from 'exif-js'.getData.I have the exif-js library (v2.3.0) located in the `source/` directory of this
project. I also have a USAGE.md file that documents the full public API and
integration steps.
Please integrate exif-js into my existing project by doing the following:
1. Read `source/exif.js` and `source/exif.d.ts` to understand the real API.
2. Read `USAGE.md` for setup steps, gotchas, and working code examples.
3. Install or wire up the library so it resolves correctly (CommonJS import:
`import * as EXIF from 'exif-js'` or from the local `source/` path).
4. Add a function that accepts an HTMLImageElement (already loaded) and returns
a Promise resolving to an object with at least: Make, Model, Orientation,
DateTimeOriginal, GPSLatitude, GPSLongitude.
5. Add a second function that accepts a File object from a file input and
returns all available tags as a plain object.
6. Ensure TypeScript types are correct; use the EXIFStatic interface from
`source/exif.d.ts`.
7. Do not invent any API methods. Only use getData, getTag, getAllTags, pretty,
and readFromBinaryFile as documented in USAGE.md.
8. Show me where to place the integration files and how to call these functions
from my existing entry point.
exif-js is released under the MIT License (see source/LICENSE.md). Upstream package: exif-js on npm — original repository at github.com/exif-js/exif-js.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
전체 설치 가이드와 연동 프롬프트는 구매 후 열람할 수 있습니다.
Automation, Utilities & Developer Tools
무료