https://bugs.kde.org/show_bug.cgi?id=386299

caulier.gil...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Add ExifTool based metadata |Add ExifTool based wrapper
                   |wrapper as in XnView        |to read and write metadata

--- Comment #8 from caulier.gil...@gmail.com ---
Hi Maik,

* I experimented and review code from 2 ExifTool parser:

- the official C++ version from ExifTool author:

https://exiftool.org/cpp_exiftool/

This one use a low level C ANSI call internally and capture meta information
using a PHP compliant container. It's limited to capture non binary tags
values. So typically to get and set preview, markernote, icc profile, xmp
packet, it's not possible. To evolve the C ANSI code is a puzzle. I tried, and
after to reformat all source code to understand the structure, i admit this
wrapper is not adapted for DK. Also this code do not compile under Windows with
MSVC, only MinGW. The advantage to this wrapper is the speed and the capability
to chain requests with a pending instance of ExifTool in memory.

- this recent Qt wrapper from Github :

https://github.com/philvl/ZExifTool

Compatible with Qt5 and Qt6, this one use a json container to handle ExifTool
information. This code is more simple as all the json parsing is delegate to
Qt. It's definitively the best way to do, event if code is a little bit slower
the official C++ wrapper. It can also chain request to ExifTool, but it use Qt
signal slot mechanism with QProcess, which is less adapted to DMetadata
integration. So is write a parser class to delegate and capture signal event
from the core class with a dedicated event loop and now the code can be
streamlined in DMetadata in a synchronous run-time. This code is fully
portable.

* I write 2 unit tests : one to display the ExifTool parsing results with Exiv2
tags conversion, and another one to backport ExifTool tags to Exiv2 with
DMetadata container. Both work as expected, even if improvements still in my
TODO list.

* I write a ExifTool to Exiv2 tags converter (and vis-versa). Basically, one
main hash table need to be populated to know the correspondence. I started to
write the tags map one by one, and it really a huge task to achieve. It work
but it's not the right way to do, as typically, the main tag "name" is at 80%
the same between ExifTool and Exiv2:

ExifTool tag naming scheme : group0:group1:group2:name
Exiv2 tag naming scheme    : family.group.name

Take a look to the current hard-coded Exif tags list for ex :

https://invent.kde.org/graphics/digikam/-/blob/c761d5550dc02edefbf003f8e9deabba1196021e/core/tests/metadataengine/exiftool/common/exiftooltranslator_exif.cpp

A better way is to write generic rules to populate the hash table automatically
which will support 80% of ExifTool tags compatible with Exiv2. For the 20%
left, custom rules must be written to handle exceptions. A unit test to
validate conversion and to found new exception must be written.

VoilĂ , i continue to work on this ExifTool wrapper to at least provide a read
metadata mechanism for 7.3.0 or 7.4.0

My best

Gilles

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to