|
List Info
Thread: Image Metadata extraction : implementation progress...
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-02-28 10:09:29 |
Hi all digiKam users/team,
Like you have seen last week, I have started a new
implementation of metadata
viewer using libExiv2 instead the current Exif viewer using
libkexif.
A fresh screenshot can be seen here :
http://digikam3rdparty.free.fr/Screenshots/dig
ikam0.9.0-alpha6.png
After any days of indeep testing, the implementation is more
mature. Like you
can see in this screenshot, we have :
- A standard Exif metatada viewer.
- An Exif Maker Notes viewer
- An IPTC metadata viewer.
- Support of CRW metadata (thanks exiv2)
- Support of Raw profiles embedded (Exif/IPTC) in PNG files
built by
ImageMagick during JPEG -> PNG conversion.
- Each sidebar tab can be filtered to "Simple"
(user friendly: the more
important for photograph) and to "Full" (all
metadata).
- All metadata groups are more visible than old Exif viewer.
The implementation is based on 2 parts :
-> One metadata extractor witch detect the file type and
use a dedicaced
loader to construct Exiv2 metadata container. Actually JPEG,
PNG and CRW
files are supported. I have planed to do TIFF/DNG files and
any others RAW
files like NEF (Paco if you is interresed (:=)))) and MRW.
The implementation
is similar to Digikam: Img
container (about loader)...
-> A large collection of widgets to display metadata in
sidebar.
I will provide a patch against svn in a near future...
Plan outside 0.9.0 issue :
- add a button to copy metadata info in clipboard.
- add a button to print metadata.
- make Iptc viewer like Iptc Editor about file supported in
writting mode
using Exiv2.
- add Xmp support (I hope that Xmp will be supported to
Exiv2 in the future)
- add a metada setup filter like in KPhotoAlbum.
Current Exiv2 problems (correct me if i'm wrong (:=))) :
- The tags descriptions exist in Exiv2 but I can access it
easily in my
implementation...
- The exiv2 lib isn't yet i18n using gettext (like
libexif). I suppose that
point is pending.
Important notice to digiKam developpers : the better way to
support more file
formats in digiKam about metadata extraction (like new RAW
files) is to
contrib on Exiv2 project. I will only make any read only
metadata loader in
digiKam (like for TIFF file). This code could be used later
in exiv2 if
necessary...
Thanks for your comments.
Gilles Caulier.
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-02-28 11:39:05 |
Le Mardi 28 Février 2006 11:09, Gilles Caulier a écrit :
> Hi all digiKam users/team,
>
> Like you have seen last week, I have started a new
implementation of
> metadata viewer using libExiv2 instead the current Exif
viewer using
> libkexif.
>
> A fresh screenshot can be seen here :
>
> http://digikam3rdparty.free.fr/Screenshots/dig
ikam0.9.0-alpha6.png
>
> After any days of indeep testing, the implementation is
more mature. Like
> you can see in this screenshot, we have :
>
> - A standard Exif metatada viewer.
> - An Exif Maker Notes viewer
> - An IPTC metadata viewer.
> - Support of CRW metadata (thanks exiv2)
> - Support of Raw profiles embedded (Exif/IPTC) in PNG
files built by
> ImageMagick during JPEG -> PNG conversion.
> - Each sidebar tab can be filtered to
"Simple" (user friendly: the more
> important for photograph) and to "Full"
(all metadata).
> - All metadata groups are more visible than old Exif
viewer.
>
> The implementation is based on 2 parts :
>
> -> One metadata extractor witch detect the file type
and use a dedicaced
> loader to construct Exiv2 metadata container. Actually
JPEG, PNG and CRW
> files are supported. I have planed to do TIFF/DNG files
and any others RAW
> files like NEF (Paco if you is interresed (:=)))) and
MRW. The
> implementation is similar to Digikam: Img
container (about loader)...
>
> -> A large collection of widgets to display metadata
in sidebar.
>
> I will provide a patch against svn in a near future...
>
Here we are a patch against current digikam from svn
'trunk' branch :
http://digikam3rdparty.free.fr/misc.tarballs/metadata.
diff
Gilles Caulier
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-02-28 15:51:05 |
Hi,
Thanks for using Exiv2!
On Tuesday 28 February 2006 19:39, Gilles Caulier wrote:
> Le Mardi 28 Février 2006 11:09, Gilles Caulier a
écrit :
> > Hi all digiKam users/team,
> >
> > Like you have seen last week, I have started a new
implementation of
> > metadata viewer using libExiv2 instead the current
Exif viewer using
> > libkexif.
> >
> > A fresh screenshot can be seen here :
> >
> > http://digikam3rdparty.free.fr/Screenshots/dig
ikam0.9.0-alpha6.png
Nice pictures. I noticed that the metadata is shown as plain
values as opposed
to human readable strings, e.g., "ResolutionUnit
2" as opposed to
"ResolutionUnit inch". Can the user change that
with the "Level of detail"
setting ("Simple" sounds like not everything is
shown though)? Especially for
makernotes, the more readable expressions might be more
useful than plain
values. You can get these easily by using the output
operator for Exifdatum.
>
> Current Exiv2 problems (correct me if i'm wrong (:=)))
:
>
> - The tags descriptions exist in Exiv2 but I can access
it easily in my
> implementation...
Assuming this should read "can _not_ access it
easily" and refers to the
commented code in eg, ExifWidget::getTagDescription(): What
about smth like
this (ignoring the conversions from and to QString):
try {
Exiv2::ExifKey ek(key);
return Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId());
}
catch (Exiv2::AnyError& e) {
// not an Exif key
}
Admittedly, this is still not really nice. And yes, it
doesn't use gettext
yet.
Thanks for encouraging contributions to Exiv2. i18n support
is a particularly
good candidate for someone who knows or would like to learn
gettext.
>
> Here we are a patch against current digikam from svn
'trunk' branch :
>
> http://digikam3rdparty.free.fr/misc.tarballs/metadata.
diff
In DMetaLoader::loadWithExiv2()
+ Exiv2::ExifData& exifData =
image->exifData();
----------^
Reference to prevent copying (and similar for Iptc).
+ catch( Exiv2::AnyError &e )
----------^^^ Baseclass in case future versions
have more error
classes
+ {
+ kdDebug() << "Cannot load metadata
using Exiv2 (" << e << ")"
<<
endl;
If you wanted the error message instead of just a code
------^
+ return false;
+ }
Further down, there is this remark:
+ // We trying to load exif data using likexif from THM
file (thumbnail) if
exist,
// especially provided by recent USM camera.
When reading from Canon CRW files, it might be interesting
to check if there
is a correspoding THM file and use that instead. (At least
some) Canon
cameras write such files together with CRW files and they
contain the
complete Exif metadata instead of only a small subset, like
the CRW file.
Exiv2 can read Canon THM files, they are just small Jpegs.
>
> Gilles Caulier
Regards,
Andreas
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-01 22:06:19 |
Le Mardi 28 Février 2006 04:51 PM, Andreas Huggel a écrit :
> Hi,
>
> Thanks for using Exiv2!
>
> On Tuesday 28 February 2006 19:39, Gilles Caulier
wrote:
> > Le Mardi 28 Février 2006 11:09, Gilles Caulier a
écrit :
> > > Hi all digiKam users/team,
> > >
> > > Like you have seen last week, I have started
a new implementation of
> > > metadata viewer using libExiv2 instead the
current Exif viewer using
> > > libkexif.
> > >
> > > A fresh screenshot can be seen here :
> > >
> > > http://digikam3rdparty.free.fr/Screenshots/dig
ikam0.9.0-alpha6.png
>
> Nice pictures. I noticed that the metadata is shown as
plain values as
> opposed to human readable strings, e.g.,
"ResolutionUnit 2" as opposed to
> "ResolutionUnit inch". Can the user change
that with the "Level of detail"
> setting ("Simple" sounds like not
everything is shown though)? Especially
> for makernotes, the more readable expressions might be
more useful than
> plain values. You can get these easily by using the
output operator for
> Exifdatum.
I have tried to do it like this :
for (Exiv2::ExifData::iterator md =
exifData.begin(); md !=
exifData.end(); ++md)
{
...
Exiv2::Exifdatum ed =
exifData[md->key().c_str()];
...
}
... but after, i need to do what exactly ?
And another question : how to get a more user friendly value
of tag. The Exif
data are sometime uninterpreted number values instead of
strings. EG for a
Nikon Camera there is a FlashpixVersion string which ist
shown as 48 49 48 48
probably meaning 1.00. Other things like exposure time
(and many more) are
displayed as a fraction (10/200) instead of a clearer value
(1/20). This kind
of interpretation problems happen in many other EXIF tags as
well.
There is a way in Exiv2 to solve it or i need to polish the
Exiv2 output in
digiKam ?
>
> > Current Exiv2 problems (correct me if i'm wrong
(:=))) :
> >
> > - The tags descriptions exist in Exiv2 but I can
access it easily in my
> > implementation...
>
> Assuming this should read "can _not_ access it
easily" and refers to the
> commented code in eg, ExifWidget::getTagDescription():
What about smth like
> this (ignoring the conversions from and to QString):
>
> try {
> Exiv2::ExifKey ek(key);
> return Exiv2::ExifTags::tagDesc(ek.tag(),
ek.ifdId());
> }
> catch (Exiv2::AnyError& e) {
> // not an Exif key
> }
>
> Admittedly, this is still not really nice. And yes, it
doesn't use gettext
> yet.
Ok descriptions implemented. Work fine.
>
> Thanks for encouraging contributions to Exiv2. i18n
support is a
> particularly good candidate for someone who knows or
would like to learn
> gettext.
>
> > Here we are a patch against current digikam from
svn 'trunk' branch :
> >
> > http://digikam3rdparty.free.fr/misc.tarballs/metadata.
diff
>
> In DMetaLoader::loadWithExiv2()
>
> + Exiv2::ExifData& exifData =
image->exifData();
> ----------^
> Reference to prevent copying (and similar for Iptc).
>
> + catch( Exiv2::AnyError &e )
> ----------^^^ Baseclass in case future
versions have more error
> classes
> + {
> + kdDebug() << "Cannot load metadata
using Exiv2 (" << e << ")"
<<
> endl;
> If you wanted the error message instead of just a code
------^
> + return false;
> + }
>
Ok, i will fix it.
> Further down, there is this remark:
>
> + // We trying to load exif data using likexif from
THM file (thumbnail)
> if exist,
> // especially provided by recent USM camera.
>
> When reading from Canon CRW files, it might be
interesting to check if
> there is a correspoding THM file and use that instead.
(At least some)
> Canon cameras write such files together with CRW files
and they contain the
> complete Exif metadata instead of only a small subset,
like the CRW file.
> Exiv2 can read Canon THM files, they are just small
Jpegs.
>
This job is now implemented in digiKam camera interface. If
a .thm file is
found, i will use this file to display metadata. For
example, with my Minolta
5D, all RAW files are associed with a small .thm file.
Thanks for you help Andreas
Gilles Caulier
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 01:29:58 |
Caulier Gilles wrote:
>And another question : how to get a more user friendly
value of tag. The Exif
>data are sometime uninterpreted number values instead of
strings. EG for a
>Nikon Camera there is a FlashpixVersion string which ist
shown as 48 49 48 48
>probably meaning 1.00. Other things like exposure time
(and many more) are
>displayed as a fraction (10/200) instead of a clearer
value (1/20). This kind
>of interpretation problems happen in many other EXIF
tags as well.
>
>There is a way in Exiv2 to solve it or i need to polish
the Exiv2 output in
>digiKam ?
>
>
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator md =
exifData.begin(); md !=
end; ++md) {
std::ostringstream os;
os << *md;
// then work with os.str()
}
This provides the more readable tag values, it will take
care of many
but not all of these issues, because not all tags have a
"pretty-print-function" and in some cases you
may want more logic e.g.
to choose a tag depending on its availability. E.g., for
Exposure time
try the ExposureTime tag, if it doesn't exist, try
ShutterSpeedValue.
If a pretty-print-function is missing, let me know, it can
easily be
added. All that is needed is a function which is registered
in the tag
lookup table. For example, look for print0x0112 in
tags.[ch]pp.
For sample code to print a summary of the Exif data, see
Print::printSummary() in actions.cpp (used in the exiv2
utility).
-ahu.
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 07:38:50 |
Le Mardi 28 Février 2006 16:51, Andreas Huggel a écrit :
> In DMetaLoader::loadWithExiv2()
>
> + Exiv2::ExifData& exifData =
image->exifData();
> ----------^
> Reference to prevent copying (and similar for Iptc).
>
> + catch( Exiv2::AnyError &e )
> ----------^^^ Baseclass in case future
versions have more error
> classes
> + {
> + kdDebug() << "Cannot load metadata
using Exiv2 (" << e << ")"
<<
> endl;
> If you wanted the error message instead of just a code
------^
> + return false;
> + }
Ok. Implementation fixed. I wil provide a new diff against
svn trunk...
Gilles
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 07:18:58 |
Le Jeudi 2 Mars 2006 02:29, vous avez écrit :
> Caulier Gilles wrote:
> >And another question : how to get a more user
friendly value of tag. The
> > Exif data are sometime uninterpreted number values
instead of strings. EG
> > for a Nikon Camera there is a FlashpixVersion
string which ist shown as
> > 48 49 48 48 probably meaning 1.00. Other things
like exposure time (and
> > many more) are displayed as a fraction (10/200)
instead of a clearer
> > value (1/20). This kind of interpretation problems
happen in many other
> > EXIF tags as well.
> >
> >There is a way in Exiv2 to solve it or i need to
polish the Exiv2 output
> > in digiKam ?
>
> Exiv2::ExifData::const_iterator end =
exifData.end();
> for (Exiv2::ExifData::const_iterator md =
exifData.begin(); md !=
> end; ++md) {
> std::ostringstream os;
> os << *md;
> // then work with os.str()
> }
>
ok. I have used this way. All tags value are displayed
nicely now. thanks
(:=))
> This provides the more readable tag values, it will
take care of many
> but not all of these issues, because not all tags have
a
> "pretty-print-function" and in some cases
you may want more logic e.g.
> to choose a tag depending on its availability. E.g.,
for Exposure time
> try the ExposureTime tag, if it doesn't exist, try
ShutterSpeedValue.
>
> If a pretty-print-function is missing, let me know, it
can easily be
> added. All that is needed is a function which is
registered in the tag
> lookup table. For example, look for print0x0112 in
tags.[ch]pp.
>
> For sample code to print a summary of the Exif data,
see
> Print::printSummary() in actions.cpp (used in the exiv2
utility).
right. I will take a look.
Ok, we have improved the "tag values" output.
Now, still the problem to do an
user friendly output of "tag names" like :
DateTimeOriginal ==> Image timestamp.
In ExifWidget::decodeMetadata() my implementation is :
...
for (Exiv2::ExifData::iterator md = exifData.begin(); md !=
exifData.end();
++md)
{
QString key =
QString::fromLocal8Bit(md->key().c_str());
// Decode the tag value with a user friendly
output.
std::ostringstream os;
os << *md;
QString value =
QString::fromLocal8Bit(os.str().c_str());
// We apply a filter to get only standard Exif
tags, not maker
notes.
if
(stdExifFilter.contains(key.section(".", 1, 1)))
metaDataMap.insert(key, value);
}
There is a way to make it automaticly using Exiv2 ?
Gilles
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 11:09:59 |
Gilles Caulier wrote:
>Ok, we have improved the "tag values"
output. Now, still the problem to do an
>user friendly output of "tag names" like :
>
>DateTimeOriginal ==> Image timestamp.
>
>
I missed that one out. Try Exiv2::ExifTags::tagTitle(), I
think this is
what you are looking for, although these labels may need
tweaking.
Suggestions welcome.
>In ExifWidget::decodeMetadata() my implementation is :
>
>...
>
>for (Exiv2::ExifData::iterator md = exifData.begin(); md
!= exifData.end();
>++md)
> {
> QString key =
QString::fromLocal8Bit(md->key().c_str());
>
> // Decode the tag value with a user friendly
output.
> std::ostringstream os;
> os << *md;
> QString value =
QString::fromLocal8Bit(os.str().c_str());
>
> // We apply a filter to get only standard
Exif tags, not maker
>notes.
> if
(stdExifFilter.contains(key.section(".", 1, 1)))
> metaDataMap.insert(key, value);
> }
>
>There is a way to make it automaticly using Exiv2 ?
>
>
Not sure which part you'd like to have automated, but I
can't see
anything that Exiv2 could do for you here.
If anything, I suggest to decode the value only inside the
if, i.e.,
only if you actually need it.
-ahu.
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 13:48:04 |
Hi all,
The version 2 of the metadata diff patch against 'trunk'
svn is done.
You can donwload it at this url :
http://digikam3rdparty.free.fr/misc.tarballs/metadata
2.diff
The patch can be applied from a fresh svn checkout like this
:
[gilles lserv3 digikam]$ pwd
/home/gilles/Documents/Devel/SVN/trunk/graphics.full/digikam
[gilles lserv3 digikam]$ patch -p0 < metadata2.diff
patching file libs/dimg/dimg.cpp
patching file libs/dimg/dimg.h
patching file libs/dimg/dimgloader.cpp
patching file libs/dimg/loaders/pngloader.cpp
patching file libs/dimg/loaders/jpegloader.cpp
patching file libs/dimg/loaders/rawloader.cpp
patching file libs/dimg/Makefile.am
patching file libs/dimg/dimgloader.h
patching file libs/dmetadata/dmetadata.cpp
patching file libs/dmetadata/loaders/dmetaloader.cpp
patching file libs/dmetadata/loaders/pngmetaloader.cpp
patching file libs/dmetadata/loaders/jpegmetaloader.cpp
patching file libs/dmetadata/loaders/dmetaloader.h
patching file libs/dmetadata/loaders/tiffmetaloader.cpp
patching file libs/dmetadata/loaders/pngmetaloader.h
patching file libs/dmetadata/loaders/rawmetaloader.cpp
patching file libs/dmetadata/loaders/jpegmetaloader.h
patching file libs/dmetadata/loaders/Makefile.am
patching file libs/dmetadata/loaders/tiffmetaloader.h
patching file libs/dmetadata/loaders/rawmetaloader.h
patching file libs/dmetadata/Makefile.am
patching file libs/dmetadata/dmetadata.h
patching file libs/imageproperties/imagepropertiessidebar.h
patching file
libs/imageproperties/imagepropertiessidebardb.cpp
patching file
libs/imageproperties/imagepropertiesexiftab.cpp
patching file libs/imageproperties/imagepropertiesexiftab.h
patching file
libs/imageproperties/imagepropertiessidebarcamgui.cpp
patching file
libs/imageproperties/imagepropertiessidebarcamgui.h
patching file libs/imageproperties/Makefile.am
patching file
libs/imageproperties/imagepropertiessidebar.cpp
patching file libs/widgets/metadata/makernotewidget.h
patching file libs/widgets/metadata/exifwidget.cpp
patching file libs/widgets/metadata/iptcwidget.cpp
patching file libs/widgets/metadata/exifwidget.h
patching file libs/widgets/metadata/metadatalistview.cpp
patching file libs/widgets/metadata/iptcwidget.h
patching file libs/widgets/metadata/metadatalistview.h
patching file libs/widgets/metadata/mdkeylistviewitem.cpp
patching file libs/widgets/metadata/mdkeylistviewitem.h
patching file libs/widgets/metadata/metadatawidget.cpp
patching file libs/widgets/metadata/metadatalistviewitem.cpp
patching file libs/widgets/metadata/Makefile.am
patching file libs/widgets/metadata/makernotewidget.cpp
patching file libs/widgets/metadata/metadatawidget.h
patching file libs/widgets/metadata/metadatalistviewitem.h
patching file libs/widgets/Makefile.am
patching file libs/Makefile.am
patching file utilities/cameragui/cameraui.cpp
[gilles lserv3 digikam]$
What news :
- Shorting automaticly Exif metadata groups by prefered
photograph order :
"Photograph Informations" and "Image
Inforlations" are always on the top of
the list (Request by Rainer)
- Using user friendly tags values (Request by Rainer and
Paco - thanks to
Andreas)
- Tags descriptions is implemented. If you select a tag and
you use What's
this menu, you will have a tooltip view appear. (thanks to
Andreas)
- New button to copy to clipboard all current metadata.
- New button to print all current metadata.
- Any widget optimizations and bugfix.
There is a screenshot here :
http://digikam3rdparty.free.fr/Screenshots/dig
ikam0.9.0-alpha7.png
TODO : trying to use user friendly tags name instead
internal Exiv2 tags name.
Andreas, how i can do it (if it's possible) ?
All comments welcome...
Gilles Caulier
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
| Image Metadata extraction :
implementation progress... |

|
2006-03-02 15:35:13 |
Le Jeudi 2 Mars 2006 12:09, vous avez écrit :
> Gilles Caulier wrote:
> >Ok, we have improved the "tag values"
output. Now, still the problem to do
> > an user friendly output of "tag names"
like :
> >
> >DateTimeOriginal ==> Image timestamp.
>
> I missed that one out. Try Exiv2::ExifTags::tagTitle(),
I think this is
> what you are looking for, although these labels may
need tweaking.
> Suggestions welcome.
Ok. Implemented. work fine. Any tags title need to be
improved. I will provide
a full list. My second diff patch have been updated...
>
> >In ExifWidget::decodeMetadata() my implementation
is :
> >
> >...
> >
> >for (Exiv2::ExifData::iterator md =
exifData.begin(); md !=
> > exifData.end(); ++md)
> > {
> > QString key =
QString::fromLocal8Bit(md->key().c_str());
> >
> > // Decode the tag value with a user
friendly output.
> > std::ostringstream os;
> > os << *md;
> > QString value =
QString::fromLocal8Bit(os.str().c_str());
> >
> > // We apply a filter to get only
standard Exif tags, not maker
> >notes.
> > if
(stdExifFilter.contains(key.section(".", 1, 1)))
> > metaDataMap.insert(key, value);
> > }
> >
> >There is a way to make it automaticly using Exiv2 ?
>
> Not sure which part you'd like to have automated, but
I can't see
> anything that Exiv2 could do for you here.
> If anything, I suggest to decode the value only inside
the if, i.e.,
> only if you actually need it.
I will take a look.
Gilles
_______________________________________________
Digikam-users mailing list
Digikam-users kde.org
h
ttps://mail.kde.org/mailman/listinfo/digikam-users
|
|
|
|