Pregunta

I'm creating composite images using Rmagick and want to include some specific info (author etc.) in the image file metadata, but can't find an obvious way to do this in the Rmagick docs, can this be done?

Sorry if this is an obvious one, but I've been searching around on both the Rmagick docs and here, but have only found a couple of items about orientation on SO, nothing about writing to metadata.

From the Rmagick Docs; Annotate seems to write the info on the image, which isn't what I want to do, I just want to store it in the metadata.

Comment looks promising but I'm not sure if this will be visible to other users when written?

¿Fue útil?

Solución

I was able to put in an EXIF XMP tag using the properties

image = Magick::Image.new(1, 1)    
image['comment'] = 'Testing'
image.write('test.png')

And than I can read the data using the exiftool:

exiftool test.png

...
Comment                         : Testing
...

Also, this site is useful for reading the EXIF image data.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top