Skip to content

Commit

Permalink
feat(WriteTask): Add struct+array test
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfest committed Sep 22, 2024
1 parent e638046 commit dfd3d28
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/WriteTask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -836,5 +836,32 @@ describe("WriteTask", function () {
// const missing = Object.keys(before).filter((k) => !(k in after))
// console.log({ missing })
})

it("supports creating arrays in structs", async () => {
const f = await testImg()
const regionData = {
RegionInfo: {
AppliedToDimensions: { W: 10, H: 10, Unit: "pixel" },
RegionList: [
{
Area: { X: 0.5, Y: 0.5, W: 0.1, H: 0.1, Unit: "normalized" },
Rotation: 0,
Type: "Face",
Name: "randomName1",
},
{
Area: { X: 0.5, Y: 0.5, W: 0.1, H: 0.1, Unit: "normalized" },
Rotation: 0,
Type: "Face",
Name: "randomName2",
},
],
},
}

await exiftool.write(f, regionData)
const after = await exiftool.read(f)
expect(after).to.containSubset(regionData)
})
})
})

0 comments on commit dfd3d28

Please sign in to comment.