Closed t-bltg closed 1 year ago
We need to replicate this here in ExifViewer.jl: https://github.com/libexif/libexif/blob/c8f62dac9960bac31975b30526ae213a979be7c4/contrib/examples/write-exif.c#L234
To add support:
elseif entry.format == LibExif.EXIF_FORMAT_ASCII
len = sizeof(tagv)+1
unsafe_store!(ptrentry.size, Cuint(len), 1)
unsafe_store!(ptrentry.components, Culong(len), 1)
mem = LibExif.exif_mem_new_default()
buf = LibExif.exif_mem_alloc(mem, len)
unsafe_copyto!(buf, pointer(Vector{UInt8}(tagv * "\0")), len)
ptrentry.data = buf
https://github.com/JuliaImages/ExifViewer.jl/blob/7595cb2c6858404527620dd7f9507b31534d8c6a/src/write.jl#L48
This section does most of it but EXIF_TAG_USER_COMMENT
format is passed as UNDEFINED
so it enters the undefined section of if-else where support for EXIF_TAG_USER_COMMENT
is not there.
https://github.com/JuliaImages/ExifViewer.jl/blob/7595cb2c6858404527620dd7f9507b31534d8c6a/src/write.jl#L59 This section is supposed to support writing of this tag
Many thanks @ashwani-rathee for the pointers. I will make a PR as soon as possible.
My use case is adding a git hash to some generated images metadata, for reproducibility.
I can make a PR and add tests, if someone could point me in the right direction (I'm not familiar with
libexif
).