LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable BMFF support in underlying library

Entropy512 opened this issue · comments

Since it appears that pyexiv2 uses self-built versions of the underlying library, instead of the system library version, this winds up relevant even if the system library (Ubuntu 22.04 in my case - you can see that https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/exiv2/0.27.5-4/exiv2_0.27.5-4.debian.tar.xz enables BMFF support)

BMFF support defaults to disabled in 0.27.5, but will default to enabled going forward - see https://github.com/Exiv2/exiv2/wiki/BMFF-Legals

In general, there were concerns that a patent may apply to the base BMFF container, but no one who raised these concerns could point to an actual applicable patent that was relevant to the base container format (as opposed to codecs such as H.264 and H.265 that are also part of the MPEG specification release). Gentoo and Ubuntu at the least have defaulted to enabling this feature. Even Debian upstream has enabled BMFF support: https://metadata.ftp-master.debian.org/changelogs//main/e/exiv2/exiv2_0.27.5-4_changelog

Please re-release with -DEXIV2_ENABLE_BMFF=On

Hi
Previously, the windows build package of exiv2 0.27.4 did not include BMFF at compile time, so I compiled the windows package myself for pyexiv2.

:: copy %EXIV2_DIR%\bin\exiv2.dll %LIB_DIR%
:: Do not use the official current release exiv2.dll as it does not set `EXIV2_ENABLE_BMFF=ON` at compile time.

Currently, pyexiv2 v2.8.1 is based on exiv2 v0.27.5 . Download the distribution of exiv2 at build time.

curl -LO %EXIV2_BUILDS_URL%
python -m zipfile -e %EXIV2_BUILD_NAME%%EXIV2_BUILD_EXT% .
copy %EXIV2_DIR%\bin\exiv2.dll %LIB_DIR%

Therefore, pyexiv2 v2.8.1 has the same default value for BMFF as exiv2 v0.27.5 .

Aha - it seems like the solution here would be to build exiv2 from source with ENABLE_BMFF on for Linux too - I'll take a crack at attempting to do this/enable it later this week.

You don't have to compile it yourself.
The current exiv2 release is compiled with EXIV2_ENABLE_BMFF=ON
https://github.com/Exiv2/exiv2/blob/eae83b44507d2a08636532142e611a642139f494/.github/workflows/release.yml#L44

So you only need to call pyexiv2.enableBMFF() once in Python code.

BTw, I confirmed that it is indeed working by calling enableBMFF. BMFF is a huge mess, but that's upstream's issue not yours.