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

[WIP] Add ISO/IEC Base Media File Format #1458

Closed
wants to merge 8 commits into from

Conversation

1div0
Copy link
Collaborator

@1div0 1div0 commented Jan 24, 2021

These are the very first steps toward bringing support of the ISO/IEC Base Media File Format including AVIF, HEIF and CR3.

Please review.

Many thanks beforehand.

@1div0 1div0 requested a review from cryptomilk January 24, 2021 14:17
@lgtm-com
Copy link

lgtm-com bot commented Jan 24, 2021

This pull request introduces 1 alert when merging 92469f4 into aa43be4 - view on LGTM.com

new alerts:

  • 1 for Missing return statement

@clanmills clanmills requested review from clanmills and removed request for cryptomilk January 24, 2021 18:36
@clanmills clanmills added this to the v0.27.4 milestone Jan 24, 2021
@clanmills
Copy link
Collaborator

clanmills commented Jan 24, 2021

This looks like a good start, Peter. Your code is causing the existing JP2 code in src/jp2image.cpp to be ignored and instead throws the error "The file contains data of an unknown image type" which causes every reference to that code by the test suite to fail. This is in the Image Factory and isn't very difficult to fix, so I'll fix this for you and get your PR to pass the test suite.

The ImageFactory sequentially searches a table of image types. We have to be sure to call the jp2image.cpp "sniffer" before your nice new src/isobmff.cpp code. There's a bug in that table concerning jp2 which I've changed to 19 (in jp2image.cpp). Those const int things have been changed to an enum in 'master'. We have to endure the pain that

Can you change isobmff.cpp/.hpp to be bmffimage.cpp/.hpp to match the other image handlers jp2image, jpegimage and so on.

Once we have the "boiler plate" in place, we'll have to focus on readMetadata() and that involves porting the code from tvisitor class Jp2Image into exiv2. And then update the test suite and documentation README.md and man/man1/exiv2.1. We'll get there soon enough.

@lgtm-com
Copy link

lgtm-com bot commented Jan 24, 2021

This pull request introduces 1 alert when merging 460a802 into aa43be4 - view on LGTM.com

new alerts:

  • 1 for Missing return statement

@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2021

This pull request introduces 1 alert when merging c608148 into aa43be4 - view on LGTM.com

new alerts:

  • 1 for Empty branch of conditional

@clanmills
Copy link
Collaborator

Several comments, @1div0

  1. Maybe we should remove all mention of ISO and simply refer to this feature as BMFF. It's in the branch name, however that's temporary scaffolding which will disappear.

  2. I suspect static bool isBigEndian() is a relic and shouldn't be in src/jp2image.cpp (or bmffimage.cpp). We can use Image::isBigEndianPlatform() instead. If you don't want to touch src/jp2image.cpp, that's fine.

  3. Can you add code to version.cpp to output enable_bmff:

733 rmills@rmillsmbp:~/gnu/github/exiv2/ISOBMFF/build $ bin/exiv2 -vV -g enable
exiv2 0.27.4.9
enable_video=0
enable_webready=0
enable_nls=0
734 rmills@rmillsmbp:~/gnu/github/exiv2/ISOBMFF/build $ 

Not only is this useful for inspection, the test harness is very likely to inspect it and skip tests when this bmff is not enabled.

@1div0
Copy link
Collaborator Author

1div0 commented Jan 27, 2021

  1. Sure, I will remove ISO abbreviation, the International Organization for Standardization. The feudal organization, as Leonardo mentioned.

  2. Most likely. I experimented with use of preprocessor macros as lowest overhead option.

  3. Will do so.


if (length == 0) return ;

if (length == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that this is missing something inside the curly braces?

Copy link
Collaborator

@clanmills clanmills Feb 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hassec This code is very much a "boiler plate" image handler. Although it recognises some file formats, it doesn't parse the file in readMetadata() to locate the Exif/IPTC/XMP/ICC data blocks. The code to do this is in tvisitor.cpp in my book and has to be ported here. I think the necessary code will be of the order of 500 lines.

Another matter is to implement writeMetadata() which serialises the in-memory metadata into blocks and updates the file. We also need to augment the test suite.

exiv2arch

@1div0 I'm concerned that you haven't updated the PR for a few weeks. The project schedule for Code Complete is less than 3 weeks away on 2021-02-28. Are you confident of making the schedule or would you like me to get involved? #1018 (comment)

@clanmills
Copy link
Collaborator

I'm going to close this. Work is proceeding here: #1475

@clanmills clanmills closed this Feb 24, 2021
@clanmills
Copy link
Collaborator

@1div0 Can delete this. I think it's dead.

@1div0
Copy link
Collaborator Author

1div0 commented Feb 24, 2021

Deleting now.

@1div0 1div0 deleted the ISOBMFF branch February 24, 2021 12:09
@clanmills clanmills mentioned this pull request Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants