Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jpeg: add encodingProcess and numColorComponents SOF members #2874

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

enen92
Copy link
Contributor

@enen92 enen92 commented Dec 29, 2023

This adds support for extracting and storing some of the metadata that can be obtained from start of frame (SOF) tags in Jpeg files, namely:

  • The encoding process
  • The number of color components

Afaik only exiftool supports such "tags" see (SOF tags in https://exiftool.org/TagNames/JPEG.html#SOF). As they don't really belong to a metadata class like exif or iptc and are only specific of a specific format (jpeg) I added them as members of Exiv2:: JpegImage. Added a small sample and test to validate the implementation.

Motivation:
Kodi currently implements its own jpeg parser and can thus obtain these two properties (https://github.com/xbmc/xbmc/blob/4532c7441510a9c9ebfa2023dd129ce13544890b/xbmc/pictures/PictureInfoTag.cpp#L416-L441 https://github.com/xbmc/xbmc/blob/master/xbmc/pictures/JpegParse.cpp#L73-L87). With my aim to rewrite the implementation based on exiv2 (xbmc/xbmc#24109) they'll be removed if no alternative exists. So I decided to have a go at it and leave it to your consideration to collect feedback (and check if it's possible to have it upstream).

@ghost
Copy link

ghost commented Dec 29, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@enen92 enen92 changed the title jpeg: add encodingProcess and num_color_components SOF members" jpeg: add encodingProcess and num_color_components SOF members Dec 29, 2023
@enen92 enen92 changed the title jpeg: add encodingProcess and num_color_components SOF members jpeg: add encodingProcess and numColorComponents SOF members Dec 29, 2023
Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (349c1f2) 63.89% compared to head (b9c167e) 63.90%.

Files Patch % Lines
src/jpgimage.cpp 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2874   +/-   ##
=======================================
  Coverage   63.89%   63.90%           
=======================================
  Files         103      104    +1     
  Lines       22381    22389    +8     
  Branches    10872    10876    +4     
=======================================
+ Hits        14301    14308    +7     
  Misses       5857     5857           
- Partials     2223     2224    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@enen92 enen92 force-pushed the jpeg_tags branch 5 times, most recently from f318ed5 to eeec086 Compare December 29, 2023 20:22
@enen92 enen92 closed this Dec 29, 2023
@enen92 enen92 reopened this Dec 29, 2023
@enen92 enen92 force-pushed the jpeg_tags branch 2 times, most recently from 5faf0c7 to 1344dc3 Compare December 29, 2023 21:57
@enen92 enen92 closed this Jan 2, 2024
@enen92 enen92 reopened this Jan 2, 2024
@kmilos kmilos added the imageHandler Anything related to specific ImageHandlers label Jan 2, 2024
@neheb neheb merged commit d3539ca into Exiv2:main Jan 8, 2024
60 checks passed
@enen92
Copy link
Contributor Author

enen92 commented Jan 8, 2024

@neheb thanks for merging. May I ask if you guys have any rough time estimate for a future release/tag of the library? Just to have an idea of when it's best to have it merged into upstream Kodi.

@neheb
Copy link
Collaborator

neheb commented Jan 8, 2024

@Mergifyio backport 0.28.x

best to do that if you want this in a release. current master will not be released in a long time.

Copy link
Contributor

mergify bot commented Jan 8, 2024

backport 0.28.x

✅ Backports have been created

@enen92
Copy link
Contributor Author

enen92 commented Jan 8, 2024

Thanks, I'll handle the backport tomorrow. I think this is the only required one. For all other contributions (mostly cmake options) we can carry the patches in the codebase since they only affect platforms for which we build statically anyway (and we already fulfilled our "submit upstream first" patch carrying principle).
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imageHandler Anything related to specific ImageHandlers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants