strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.71k stars 298 forks source link

Add uuid property #1156

Closed dukesook closed 3 months ago

dukesook commented 6 months ago

I'm interested in adding uuid property getters/setters to enable user-defined image metadata.

dukesook commented 6 months ago

I wasn't sure if adding a new Box_uuid class to box.h was a good idea. Instead, I extended the Box class to handle the uuid functionality.

Any feedback would be appreciated.

farindk commented 3 months ago

I wouldn't mix this with the base Box class, but introduce a catch-all Box_other class that keeps the data for everything that libheif does not (yet) understand. I wouldn't even make it uuid specific, but also for other (4cc) boxes that we do not parse yet.

farindk commented 3 months ago

I have implemented this in a slightly different way. It is now not limited to 'uuid' boxes anymore, but one can add all sorts of boxes with raw data, and also read the raw data of boxes that are not understood by libheif.

Only caveat at this time: we cannot read the raw data of boxes that were successfully parsed by libheif. This should be added, preferably by storing a pointer to the source data in the Box. But a clean implementation needs more time.

farindk commented 3 months ago

@dukesook Please review and if you think that this is ok, I'll close this PR.

dukesook commented 3 months ago

@farindk This is a great implementation, thanks for doing it. Go ahead and close this PR.