convert JPG to PNG with image magick (to preserve any metadata in the JPG)
convert PNG to FLIF
extract metadata from FLIF using the API
metadata size does not match size in JPG
This happens because flif is storing the wrong length for the metadata chunk, namely the length it has in PNG, where the chunk is hex-encoded as text. So flif metadata gets encoded with kbytes of garbage at the end of the chunk.
Scenario:
This happens because flif is storing the wrong length for the metadata chunk, namely the length it has in PNG, where the chunk is hex-encoded as text. So flif metadata gets encoded with kbytes of garbage at the end of the chunk.