How to add custom properties to image file?

Hello,

I want to add custom properties to image files using RMagick, and these properties will embed into the image file directly. And later, I can retrieve those information back. Any idea, appreciate.....

Thanks

Chamnap wrote:

Hello,

I want to add custom properties to image files using RMagick, and these properties will embed into the image file directly. And later, I can retrieve those information back. Any idea, appreciate.....

Could you elaborate on this more? Do you mean EXIF data?

Robby

I want to store some custom properties like copyright... and some other useful information that I want to show other people this image file is mine. EXIF data could be. And, I don't want other people modified this information.

Chamnap

You are not talking about EXIF data. More likely, you mean IPTC. EXIF is almost exclusively used for digital image acquisition devices to record image data like camera manufacturer, lens, shutter speed, dimensions, and so on. IPTC is where you store captions, descriptions, location, keywords, etc.

If you’re bored, http://www.iptc.org/IPTC4XMP/ gives you the nuts and bolts of IPTC. This is a Wikipedia article about EXIF: http://en.wikipedia.org/wiki/Exif.

A word of caution: Be very careful when you store anything in an image file, as they are quite brittle and one inadvertent overwrite could render the file completely unusable.

Thanks s.ross. Maybe you're right. But do you how to set those copyrights information? And I don't allow any other people to change that copyright information.

Chamnap

You're fighting an uphill battle. It is possible to change or remove
metadata, which is the problem that people who hold copyrights to
intellectual property face. If you are the sole contributor, embed
the information prior to upload and hope for the best. The problem
you face -- especially with RAW images -- is that the metadata is
seldom in the same place among the different vendors' file formats.
That's why Adobe and other image processing software vendors are in a
constant chase to keep up with it.

One other slightly blunter instrument you can use is to deface any
publicly-viewable image using a watermark, and only provide
unblemished images to those who qualify for permission to use the
copyright information. Also, post your policy prominently *in text*
on each page that displays an image.

G'luck. Nobody else is doing very well with this problem. This
discussion (also) should be taken off-list.

-s