MCPcopy
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / readExif

Method readExif

web/js/workflowImage.js:248–269  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

246 #start;
247
248 readExif(reader) {
249 const TIFF_MARKER = 0x2a;
250 const EXIF_IFD = 0x8769;
251
252 this.#reader = reader;
253 this.#start = this.#reader.offset;
254 this.#readEndianness();
255
256 if (!this.#reader.read(2) === TIFF_MARKER) {
257 throw new Error("Invalid TIFF: Marker not found.");
258 }
259
260 const dirOffset = this.#reader.read(4);
261 this.#reader.seek(this.#start + dirOffset, false);
262
263 for (const t of this.#readTags()) {
264 if (t.id === EXIF_IFD) {
265 return this.#readExifTag(t);
266 }
267 }
268 throw new Error("No EXIF: TIFF Exif IFD tag not found");
269 }
270
271 #readUserComment(tag) {
272 this.#reader.seek(this.#start + tag.offset, false);

Callers 2

readExifMethod · 0.45
initMethod · 0.45

Calls 5

#readEndiannessMethod · 0.95
#readTagsMethod · 0.95
#readExifTagMethod · 0.95
readMethod · 0.80
seekMethod · 0.80

Tested by

no test coverage detected