RSS/Atom feed Twitter
Site is read-only, email is disabled

Howto: store comments in image from plugin?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Howto: store comments in image from plugin? Joseph Heled 21 Jul 05:51
  Howto: store comments in image from plugin? Carol Spears 21 Jul 08:18
  Howto: store comments in image from plugin? Dave Neary 21 Jul 10:32
   Howto: store comments in image from plugin? Joseph Heled 22 Jul 00:34
Howto: store comments in image from plugin? William Skaggs 22 Jul 19:21
Joseph Heled
2004-07-21 05:51:10 UTC (over 20 years ago)

Howto: store comments in image from plugin?

(I hope this is the appropriate forum ...)

I am developing a plugin which loads raw images from digital cameras (CRW,NEF etc).

I would like to "attach" to the image some of the parameters of the conversion. I am not sure ,
- How do I add this info to the image (I open it with gimp_image_new(...) ) - Which file formats support this kind of comment/data?

On a related issue, how can I add EXIF data to the image? Perhaps I can add some data in the EXIF comment?

I would appreciate any help/ideas ...

Joseph

Carol Spears
2004-07-21 08:18:45 UTC (over 20 years ago)

Howto: store comments in image from plugin?

hello,
On Wed, Jul 21, 2004 at 03:51:10PM +1200, Joseph Heled wrote:

(I hope this is the appropriate forum ...)

((this should be a fine forum for these questions))

I would like to "attach" to the image some of the parameters of the conversion.
I am not sure ,
- How do I add this info to the image (I open it with gimp_image_new(...) )

when you save the image, there is a comment parameter for the file formats which have comments.

- Which file formats support this kind of comment/data?

png and jpeg. /Xtns/DB Browser will be useful to you. there are other parameters than comments to worry about while scripting TheGIMP.

also, the png comments were only recently added so use file-save-png2.

i have a script that writes a text file to each image and also writes the image number and location on my computer of each image. handy stuff. back in the old days, we used to have to mark each image by hand and wait for the ink to dry before moving onto the next image.

there might be other formats. i recommend png as it is a lossless format and really nice and free.

good luch and happy gimping,

carol

Dave Neary
2004-07-21 10:32:35 UTC (over 20 years ago)

Howto: store comments in image from plugin?

Hi,

Joseph Heled wrote:

I would like to "attach" to the image some of the parameters of the conversion.

The GIMP uses a mechanism we call parasites to attach data to an image. A good example of their use is in the jpg plug-in, for example, where we attach exif data, a comment and also save parameters. A complete list of "standard" parasites, and a short description of teh parasite mechanism, is in devel-docs in the GIMP sources.

I am not sure ,
- How do I add this info to the image (I open it with gimp_image_new(...) )
- Which file formats support this kind of comment/data?

png, tiff, jpg all support exif, iptc is supported by tiff and jpeg as well, there are lots of other metadata formats which are supported by various formats. I'm not quite sure.

On a related issue, how can I add EXIF data to the image? Perhaps I can add some
data in the EXIF comment?

We link to libexif already, and use it in the jpeg plug-in. You can construct an exif header and write it to a file in the same way as we write the exif header back to the file now.

libexif is available here: http://sourceforge.net/projects/libexif

Cheers, Dave.

Joseph Heled
2004-07-22 00:34:34 UTC (over 20 years ago)

Howto: store comments in image from plugin?

Thanks for all the people who answered.

It turned out to be as simple as attaching a "gimp-comment" and "jpeg-exif-data" parasites to the image.

(of course generating jpeg-exif-data is not trivial. Only implemented for my Nikon D70 at the moment. I guess others who like more formats will have to implement their own)

-Joseph

William Skaggs
2004-07-22 19:21:28 UTC (over 20 years ago)

Howto: store comments in image from plugin?

Joseph Heled writes:

It turned out to be as simple as attaching a "gimp-comment" and "jpeg-exif-data" parasites to the image.

Note that in Gimp 2.1 the exif data parasite has been renamed "exif-data", because it is not specific to jpeg files.

Best, -- Bill


______________ ______________ ______________ ______________ Sent via the KillerWebMail system at primate.ucdavis.edu