inflation / jpegxl-rs

GNU General Public License v3.0
56 stars 11 forks source link

Fix metadata encoding by setting `JxlEncoderUseBoxes` #54

Closed Isotr0py closed 3 months ago

Isotr0py commented 4 months ago
./lib/jxl/encode.cc:2403: must set JxlEncoderUseBoxes at the beginning to add boxes
...
called `Result::unwrap()` on an `Err` value: ApiUsage

This PR fixs the missing JxlEncoderUseBoxes setting. Maybe we can also add a test to cover the metadata encoding case?

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.97%. Comparing base (58956f0) to head (0ffb15d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #54 +/- ## ========================================== + Coverage 96.01% 97.97% +1.96% ========================================== Files 15 15 Lines 879 891 +12 ========================================== + Hits 844 873 +29 + Misses 35 18 -17 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Isotr0py commented 4 months ago

I have added tests to cover meta encodings. The sample.exif and sample.xmp were created from 1x1_exif_xmp.jpg using exiftool:

exiftool -exif -b 1x1_exif_xmp.jpg > sample.exif
exiftool -xmp -b 1x1_exif_xmp.jpg > sample.xmp
inflation commented 3 months ago

Cleaned up this PR to #58 and merged.