exif(): read HEIF/HEIC originals with exifreader (closes #145)
check / check (push) Successful in 1m21s
check / check (push) Successful in 1m21s
photo.exif() and backup-metadata --exif read EXIF with exifreader, which reads JPEG, HEIC/HEIF, AVIF, PNG and WebP, so a HEIC original or a live photo's HEIC image gets its EXIF. exifreader replaces exif-reader and the hand-written JPEG segment scan. PhotoExif is unchanged. The exif field of backup-metadata --exif is now exifreader's tag output, and exifRaw holds the whole EXIF block it could not read. Tests use a real 933-byte HEIC fixture, test/exif.heic, whose recipe is in test/exif-heic.ts. Model: opus-5-5
This commit is contained in:
@@ -56,6 +56,7 @@ import type { ContentSource } from "../../src/library/content.js";
|
||||
import type { Collection, EnteFile } from "../../src/model/types.js";
|
||||
import { init, toBase64 } from "../../src/crypto/index.js";
|
||||
import { defaultCacheDirectory } from "../../src/library/index.js";
|
||||
import { HEIC_WITH_EXIF } from "../exif-heic.js";
|
||||
import {
|
||||
asLivePhoto,
|
||||
cdnSource,
|
||||
@@ -653,6 +654,31 @@ describe("a live photo", () => {
|
||||
height: 4,
|
||||
});
|
||||
});
|
||||
|
||||
it("backup-metadata --exif records the EXIF of a HEIC image", async () => {
|
||||
const dir = join(root, "dump");
|
||||
|
||||
expect(
|
||||
await backupMetadataCommand(
|
||||
context(await livePhotoClient(HEIC_WITH_EXIF)),
|
||||
dir,
|
||||
{ exif: true },
|
||||
),
|
||||
).toBe(0);
|
||||
|
||||
const record = JSON.parse(
|
||||
readFileSync(
|
||||
join(dir, "collections", "1-Vacation", "300.json"),
|
||||
"utf-8",
|
||||
),
|
||||
);
|
||||
expect(record.imageMetadata.exifError).toBeUndefined();
|
||||
expect(record.imageMetadata.exif).toMatchObject({
|
||||
Make: { value: ["Canon"] },
|
||||
Model: { value: ["EOS R5"] },
|
||||
DateTimeOriginal: { value: ["2021:07:15 14:30:00"] },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("backup", () => {
|
||||
|
||||
Reference in New Issue
Block a user