Comments in png files

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Comments in png files

Bugzilla from pave@o2.pl
Hi there,

After Gilles' post (around June) recommending storing images in png format,
I switched to it entirely. I collected my photos, added captions etc. Now I
want to upload them to a web gallery, which only accepts jpegs. However,
after a batch conversion to jpeg, some of the photos lost their metadata
completely. During the conversion, a dialog is shown for each photo,
saying "Cannot run properly 'convert' program from 'ImageMagick' package"
and the console displays:
digikam: WARNING: Convert exit (0)

When investigating this issue I found out that when I add a caption in
digiKam, it doesn't throw any error, but the console says:
Cannot save metadata using Exiv2  (Setting Image comment in PNG images is
not supported). The added caption is shown by digiKam, but maybe it is
stored only in digiKam database?

When converting manually with convert, no error is raised, but when I try to
view the converted image in digiKam, no metadata is shown at all.

I'm using digiKam 0.9.3-beta1 with Exiv2 0.14 and KExiv2 0.1.6.

Does anyone have an idea on how I can convert hundreds my photos to jpeg and
preserve all the metadata and captions I spent so much time adding?

Thanks in advance,
Paweł

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Gilles Caulier-4


2007/11/3, Paweł Marciniak <[hidden email]>:
Hi there,

After Gilles' post (around June) recommending storing images in png format,
I switched to it entirely. I collected my photos, added captions etc. Now I
want to upload them to a web gallery, which only accepts jpegs. However,
after a batch conversion to jpeg, some of the photos lost their metadata
completely. During the conversion, a dialog is shown for each photo,
saying "Cannot run properly 'convert' program from 'ImageMagick' package"
and the console displays:
digikam: WARNING: Convert exit (0)

When investigating this issue I found out that when I add a caption in
digiKam, it doesn't throw any error, but the console says:
Cannot save metadata using Exiv2  (Setting Image comment in PNG images is
not supported).

Exiv2 do not support yet PNG metadata for writting. Patch still uncomplete on my computer.

 

The added caption is shown by digiKam, but maybe it is
stored only in digiKam database?


yes, Caption, date, rating, and tags are store in digiKam database.
 

When converting manually with convert, no error is raised, but when I try to
view the converted image in digiKam, no metadata is shown at all.

Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG (taken originally from JPEG or RAW), and metadata still present of course.

Witch camera you use ? Can you send me a JPEG file taken with your camera to test. How are you converted your JPEG files to PNG ? Using Camera interface during download ?
 

I'm using digiKam 0.9.3-beta1 with Exiv2 0.14 and KExiv2 0.1.6.

Does anyone have an idea on how I can convert hundreds my photos to jpeg and
preserve all the metadata and captions I spent so much time adding?

convert from imagemagick is the better way. I simple script with a loop to process all current files is enough.

But it sound like a problem in your imagemagick... Witch version you use ?
 
Gilles Caulier

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from pave@o2.pl
Thank you Gilles for replying!

Gilles Caulier wrote:
> Exiv2 do not support yet PNG metadata for writting. Patch still uncomplete
> on my computer.
> [...]
> yes, Caption, date, rating, and tags are store in digiKam database.

I see. Is there a way (it may even involve some hacking) to retrieve the
captions from db and embed them in jpeg files? Otherwise it's A LOT of
rewriting for me :(

>> When converting manually with convert, no error is raised, but when I try
>> to
>> view the converted image in digiKam, no metadata is shown at all.
>
> Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG
> (taken originally from JPEG or RAW), and metadata still present of course.
>
> Witch camera you use ? Can you send me a JPEG file taken with your camera
> to test. How are you converted your JPEG files to PNG ? Using Camera
> interface during download ?

Yes, there's nothing after opening the photo in digiKam (display(1),
however, sees exif metadata in the jpeg, but not iptc). I found out that
the digiKam console says:

8<-------------------------------------
Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67904;
skipped.
Cannot load metadata using Exiv2  (Failed to decode IPTC metadata)
8<-------------------------------------

It looks like ImageMagick issue, but the png may be misformated as well. The
interesting thing is that ImageMagick doesn't complain during conversion,
and upgrading it to the latest version (6.3.6-7) didn't solve the problem.
I uploaded an example (both the orginal photo and convert(1) output) to
http://pandora.cs.put.poznan.pl/~pmarciniak/digikam/ photo name
marineland-021.{jpg,png} - feel free to inspect it. All my photos were
taken with Canon S2 IS and converted to png during download.

During downloading and commenting my photo collection I was using svn
version of digiKam, recently I reverted to binary package (0.9.3-beta1),
but I guess that should not be a problem, since it is still newer than my
last svn build.

I also uploaded to the mentioned location another example, marineland-001
{jpg,png}, where the jpeg's exif metadata is shown correctly by digiKam,
but not iptc, and the console says:

8<-------------------------------------
Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67818;
skipped.
Warning: IPTC dataset Iptc.0x00ce.0x0056 has invalid size 10114; skipped.
Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67818;
skipped.
Warning: IPTC dataset Iptc.0x00ce.0x0056 has invalid size 10114; skipped.
8<-------------------------------------

Pawel


_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from pave@o2.pl
Paweł Marciniak wrote:

> Thank you Gilles for replying!
>
> Gilles Caulier wrote:
>> Exiv2 do not support yet PNG metadata for writting. Patch still
>> uncomplete on my computer.
>> [...]
>> yes, Caption, date, rating, and tags are store in digiKam database.
>
> I see. Is there a way (it may even involve some hacking) to retrieve the
> captions from db and embed them in jpeg files? Otherwise it's A LOT of
> rewriting for me :(
>
>>> When converting manually with convert, no error is raised, but when I
>>> try to
>>> view the converted image in digiKam, no metadata is shown at all.
>>
>> Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG
>> (taken originally from JPEG or RAW), and metadata still present of
>> course.
>>
>> Witch camera you use ? Can you send me a JPEG file taken with your camera
>> to test. How are you converted your JPEG files to PNG ? Using Camera
>> interface during download ?
>
> Yes, there's nothing after opening the photo in digiKam (display(1),
> however, sees exif metadata in the jpeg, but not iptc). I found out that
> the digiKam console says:
>
> 8<-------------------------------------
> Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67904;
> skipped.
> Cannot load metadata using Exiv2  (Failed to decode IPTC metadata)
> 8<-------------------------------------
>
> It looks like ImageMagick issue, but the png may be misformated as well.
> The interesting thing is that ImageMagick doesn't complain during
> conversion, and upgrading it to the latest version (6.3.6-7) didn't solve
> the problem. I uploaded an example (both the orginal photo and convert(1)
> output) to http://pandora.cs.put.poznan.pl/~pmarciniak/digikam/ photo name
> marineland-021.{jpg,png} - feel free to inspect it. All my photos were
> taken with Canon S2 IS and converted to png during download.
>
> During downloading and commenting my photo collection I was using svn
> version of digiKam, recently I reverted to binary package (0.9.3-beta1),
> but I guess that should not be a problem, since it is still newer than my
> last svn build.
>
> I also uploaded to the mentioned location another example, marineland-001
> {jpg,png}, where the jpeg's exif metadata is shown correctly by digiKam,
> but not iptc, and the console says:
>
> 8<-------------------------------------
> Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67818;
> skipped.
> Warning: IPTC dataset Iptc.0x00ce.0x0056 has invalid size 10114; skipped.
> Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67818;
> skipped.
> Warning: IPTC dataset Iptc.0x00ce.0x0056 has invalid size 10114; skipped.
> 8<-------------------------------------
>
> Pawel

Hello,

I still haven't solved my problem :( The png files in question are have been
created and touched only by digiKam, no other program.
Is anyone able to help?

Thanks,
Pawel

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Gilles Caulier-4
In reply to this post by Bugzilla from pave@o2.pl


2007/11/5, Paweł Marciniak <[hidden email]>:
Thank you Gilles for replying!

Gilles Caulier wrote:
> Exiv2 do not support yet PNG metadata for writting. Patch still uncomplete
> on my computer.
> [...]
> yes, Caption, date, rating, and tags are store in digiKam database.

I see. Is there a way (it may even involve some hacking) to retrieve the
captions from db and embed them in jpeg files? Otherwise it's A LOT of
rewriting for me :(

But al is always done by digiKam. Are you sure to have set on right right options in Metadata setup dialog page ?
 

>> When converting manually with convert, no error is raised, but when I try
>> to
>> view the converted image in digiKam, no metadata is shown at all.
>
> Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG
> (taken originally from JPEG or RAW), and metadata still present of course.
>
> Witch camera you use ? Can you send me a JPEG file taken with your camera
> to test. How are you converted your JPEG files to PNG ? Using Camera
> interface during download ?

Yes, there's nothing after opening the photo in digiKam (display(1),
however, sees exif metadata in the jpeg, but not iptc). I found out that
the digiKam console says:

8<-------------------------------------
Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67904;
skipped.

This is the problem. Preview (an embeded and reduced JPEG image) is set by digiKam in IPTC to speed up preview loading (F4).

problem is than preview IPTC can be larger than 64Kb (see iptc/iim paper) and a jpeg section (used to embeded iptc in jpeg file) is limited to 64Kb. Ther eis no size limitattion with PNG (or TIFF)

I have already fixed the problem in digiKam core, Exiv2 but not yet in kipi-plugins. Of course i will do it.

Note : it's originally a problem of imagemagick wich trunk whole iptc if size is over 64 kb during PNG=>JPEG (or TIFF=>JPEG)

Please make a file in bugzilla, in kipi-plugins/BatchProcess component. Thanks in advance

Gilles


_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from cmaessen@casco.demon.nl
In reply to this post by Bugzilla from pave@o2.pl
Op zaterdag 10 november 2007, schreef Paweł Marciniak:

  > I still haven't solved my problem :( The png files in question are
  > have been created and touched only by digiKam, no other program.
  > Is anyone able to help?

As I umderstand it right, your problem is converting your png-files to
jpg's, while preserving the metadata. I would suggest to use
imagemagick and exiftools.

Part of the imagemagick suite is the command convert:
>convert /path/to/file.png jpg:/path/to/file.jpg

With exiftools you can copy over the exif and makernote tags from the
png to the jpg-file:
>exiftool -m -fast -P -overwrite_original -tagsfromfile /path/to/file.png -all:all /path/to/file.jpg

These are both very powerfull commands, with a lot of possibilities.
Have a look at the docs and play with them. But, I advice you strongly
while you are experimenting, to do this on just a few images, and make
a backup of them first, before handling your whole collection.

Caspar.
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from pave@o2.pl
In reply to this post by Gilles Caulier-4
Gilles Caulier wrote:

> 2007/11/5, Paweł Marciniak <[hidden email]>:
>>
>> Thank you Gilles for replying!
>>
>> Gilles Caulier wrote:
>> > Exiv2 do not support yet PNG metadata for writting. Patch still
>> uncomplete
>> > on my computer.
>> > [...]
>> > yes, Caption, date, rating, and tags are store in digiKam database.
>>
>> I see. Is there a way (it may even involve some hacking) to retrieve the
>> captions from db and embed them in jpeg files? Otherwise it's A LOT of
>> rewriting for me :(
>
>
> But al is always done by digiKam. Are you sure to have set on right right
> options in Metadata setup dialog page ?

Actually, this is a bug. I filed it already:
http://bugs.kde.org/show_bug.cgi?id=152208

>>> When converting manually with convert, no error is raised, but when I
>>> try
>>
>> >> to
>> >> view the converted image in digiKam, no metadata is shown at all.
>> >
>> > Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG
>> > (taken originally from JPEG or RAW), and metadata still present of
>> course.
>> >
>> > Witch camera you use ? Can you send me a JPEG file taken with your
>> camera
>> > to test. How are you converted your JPEG files to PNG ? Using Camera
>> > interface during download ?
>>
>> Yes, there's nothing after opening the photo in digiKam (display(1),
>> however, sees exif metadata in the jpeg, but not iptc). I found out that
>> the digiKam console says:
>>
>> 8<-------------------------------------
>> Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67904;
>> skipped.
>
>
> This is the problem. Preview (an embeded and reduced JPEG image) is set by
> digiKam in IPTC to speed up preview loading (F4).
>
> problem is than preview IPTC can be larger than 64Kb (see iptc/iim paper)
> and a jpeg section (used to embeded iptc in jpeg file) is limited to 64Kb.
> Ther eis no size limitattion with PNG (or TIFF)

OK, thanks A LOT for that pointer! It allowed me to find a workaround by
removing the iptc sections from png files with `convert +profile iptc`, and
then seamlessly (well, not really, see the above bug) finishing the work
with digiKam.

> I have already fixed the problem in digiKam core, Exiv2 but not yet in
> kipi-plugins. Of course i will do it.
>
> Note : it's originally a problem of imagemagick wich trunk whole iptc if
> size is over 64 kb during PNG=>JPEG (or TIFF=>JPEG)
>
> Please make a file in bugzilla, in kipi-plugins/BatchProcess component.

I filed it. But IMHO digiKam core doesn't perform as expected either. When I
tried to convert png->jpeg by "save as..." in image editor, I got:
Cannot save metadata using Exiv2  (Size of IPTC JPEG segment is larger than
65535 bytes)
on the console, what means that it in fact recognized the problem, but the
result is that the resulting image is stripped from BOTH iptc and exif
metadata. I think a better way of handling this would be to strip just the
iptc section (exactly what I did with IM's convert). Is this a bug then?

> Thanks in advance
No, Thanks to YOU :)

Pawel

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Gilles Caulier-4


2007/11/12, Paweł Marciniak <[hidden email]>:
Gilles Caulier wrote:

> 2007/11/5, Paweł Marciniak <[hidden email]>:
>>
>> Thank you Gilles for replying!
>>
>> Gilles Caulier wrote:
>> > Exiv2 do not support yet PNG metadata for writting. Patch still
>> uncomplete
>> > on my computer.
>> > [...]
>> > yes, Caption, date, rating, and tags are store in digiKam database.
>>
>> I see. Is there a way (it may even involve some hacking) to retrieve the
>> captions from db and embed them in jpeg files? Otherwise it's A LOT of
>> rewriting for me :(
>
>
> But al is always done by digiKam. Are you sure to have set on right right
> options in Metadata setup dialog page ?

Actually, this is a bug. I filed it already:
http://bugs.kde.org/show_bug.cgi?id=152208

>>> When converting manually with convert, no error is raised, but when I
>>> try
>>
>> >> to
>> >> view the converted image in digiKam, no metadata is shown at all.
>> >
>> > Exif and iptc ??? Impossible (:=))). All my photo collection are in PNG
>> > (taken originally from JPEG or RAW), and metadata still present of
>> course.
>> >
>> > Witch camera you use ? Can you send me a JPEG file taken with your
>> camera
>> > to test. How are you converted your JPEG files to PNG ? Using Camera
>> > interface during download ?
>>
>> Yes, there's nothing after opening the photo in digiKam (display(1),
>> however, sees exif metadata in the jpeg, but not iptc). I found out that
>> the digiKam console says:
>>
>> 8<-------------------------------------
>> Warning: IPTC dataset Iptc.Application2.Preview has invalid size 67904;
>> skipped.
>
>
> This is the problem. Preview (an embeded and reduced JPEG image) is set by
> digiKam in IPTC to speed up preview loading (F4).
>
> problem is than preview IPTC can be larger than 64Kb (see iptc/iim paper)
> and a jpeg section (used to embeded iptc in jpeg file) is limited to 64Kb.
> Ther eis no size limitattion with PNG (or TIFF)

OK, thanks A LOT for that pointer! It allowed me to find a workaround by
removing the iptc sections from png files with `convert +profile iptc`, and
then seamlessly (well, not really, see the above bug) finishing the work
with digiKam.


No.

No need to remove the whole IPTC content. Just remove the iptc.application2.preview tags. You can use ExifTool to do it over PNG file. This is what i will do in BatchProcessImages kipi-plugins to fix the problem.

In fact, to be clear, IPTC spec allow to set a preview image size to 256Kb max. Of course JPEG section is limited to 64Kb. You understand the problem ?

This is a side effect and incompatibility against 2 separate spec written by 2 organizations without a real dialog : iptc.org and jpeg.org...

Gilles

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from pave@o2.pl
Gilles Caulier wrote:

> No.
>
> No need to remove the whole IPTC content. Just remove the
> iptc.application2.preview tags. You can use ExifTool to do it over PNG
> file. This is what i will do in BatchProcessImages kipi-plugins to fix the
> problem.
>
> In fact, to be clear, IPTC spec allow to set a preview image size to 256Kb
> max. Of course JPEG section is limited to 64Kb. You understand the problem
> ?

Yes, I understood the problem even before, but since I don't depend on IPTC
in my workflow, it was just easier to strip the whole thing.

I think that what you plan for BatchProcessImages can also be done in
digiKam itself (saving png as jpg in image editor).

Regards,
Pawel

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Gilles Caulier-4


2007/11/12, Paweł Marciniak <[hidden email]>:
Gilles Caulier wrote:

> No.
>
> No need to remove the whole IPTC content. Just remove the
> iptc.application2.preview tags. You can use ExifTool to do it over PNG
> file. This is what i will do in BatchProcessImages kipi-plugins to fix the
> problem.
>
> In fact, to be clear, IPTC spec allow to set a preview image size to 256Kb
> max. Of course JPEG section is limited to 64Kb. You understand the problem
> ?

Yes, I understood the problem even before, but since I don't depend on IPTC
in my workflow, it was just easier to strip the whole thing.

ok
 

I think that what you plan for BatchProcessImages can also be done in
digiKam itself

yes, this is another plan for me to make a batchqueuemanager (like BibblePro do) in digiKam core, of course when the KDE4 port will be more advanced, especially kipi-plugins. I think than 0.9.4 will be fine for that.


(saving png as jpg in image editor).

This is already fixed since 0.9.1. Try to save a jpeg file from a png file with editor...

Gilles


_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Comments in png files

Bugzilla from pave@o2.pl
Gilles Caulier wrote:
> (saving png as jpg in image editor).
>
>
> This is already fixed since 0.9.1. Try to save a jpeg file from a png file
> with editor...

OK, I think you missed part of my previous post:

8<------------------------------------------
> I have already fixed the problem in digiKam core, Exiv2 but not yet in
> kipi-plugins. Of course i will do it.
>
> Note : it's originally a problem of imagemagick wich trunk whole iptc if
> size is over 64 kb during PNG=>JPEG (or TIFF=>JPEG)
>
> Please make a file in bugzilla, in kipi-plugins/BatchProcess component.

I filed it. But IMHO digiKam core doesn't perform as expected either. When I
tried to convert png->jpeg by "save as..." in image editor, I got:
Cannot save metadata using Exiv2  (Size of IPTC JPEG segment is larger than
65535 bytes)
on the console, what means that it in fact recognized the problem, but the
result is that the resulting image is stripped from BOTH iptc and exif
metadata. I think a better way of handling this would be to strip just the
iptc section (exactly what I did with IM's convert). Is this a bug then?
8<------------------------------------------

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users