Page 1 of 1

Making Printable Metadata Labels

Posted: 2016-01-23T20:51:03-07:00
by melrom
Hi there! Super new to IM, but I could not find an easy way to do this in the docs. I would like to create metadata labels to stick on the back of my photos. The photos have already been printed, so I do not want an overlay.

This image is an example of exactly what I am looking to do. The program used to generate this one can only do one image at a time, and I need to do this for over 300 images (which is why I am looking at IM).
Image

I suspect I will need to write a script based on http://www.imagemagick.org/script/escape.php and viewtopic.php?t=18597.

However, I am a bit new to this as well, and I am not sure how I could go from printing the desired data for one image (using escapes) on command line to multiple images (recursively through multiple subdirectories). I am also not sure how I could obtain a format that looks similar to the one above -- maybe output a table or something? Any information would help! Thank you!

Re: Making Printable Metadata Labels

Posted: 2016-01-23T23:31:29-07:00
by GeeMack
melrom wrote:Hi there! Super new to IM, but I could not find an easy way to do this in the docs. I would like to create metadata labels to stick on the back of my photos. The photos have already been printed, so I do not want an overlay.
This can be done, but the difficulty would depend on several things. You should let us know the ImageMagick version you're using and describe what operating system, version, etc., you'll be working on. Also, do all the photos contain the same EXIF attributes, or will the script have to accommodate images from different cameras? It would be helpful if you can provide a few more details.

Re: Making Printable Metadata Labels

Posted: 2016-01-24T10:21:21-07:00
by melrom
Hi - thanks! I am working on Mac OS X 10.10.5 (Yosemite). Version: ImageMagick 6.9.3-0 Q16 x86_64 2016-01-08 http://www.imagemagick.org

Currently, I extracted the relevant metadata that I want into a text file. The format of the text file is as follows:

Code: Select all

 
 -------------------------------------------
File: P8240001.JPG - Date/Time Original: 2015:08:24 03:43:06
Camera: OLYMPUS IMAGING CORP. StylusTough-3000 - Serial Number: ######
(f/3.5, 1/30s, ISO 125)
 -------------------------------------------
File: P8240002.JPG - Date/Time Original: 2015:08:24 03:43:47
Camera: OLYMPUS IMAGING CORP. StylusTough-3000 - Serial Number: ######
(f/3.5, 1/30s, ISO 100)
 -------------------------------------------
 
In addition, I extracted the thumbnails into the working directory as follows:

Code: Select all

Original File: P8240001.JPG
Thumbnail File: P8240001_thumb.JPG

All I theoretically need to do at this point would be to grab the data that I want from the text file and make an image that has the thumbnail on the left side and then the text on the right side. I guess what I don't understand would be how to create the image from the thumbnail+text.

Re: Making Printable Metadata Labels

Posted: 2016-01-24T11:26:44-07:00
by snibgo
The ImageMagick command could look like this. Windows BAT syntax. Adjust for your shell/script language:

Code: Select all

convert ^
  -size 423x84 xc:White ^
  ( rose: -resize 50x70^> ) ^
  -gravity West -composite ^
  -gravity NorthWest ^
  -pointsize 10 ^
  -annotate +60+15 "Title" ^
  -annotate +60+50 "Author" ^
  -pointsize 15 ^
  -annotate +100+15 "Camera: OLYMPUS IMAGING CORP. StylusTough-3000 - Serial Number: ######" ^
  out.png
The strings would really be environment variables, of course.

Re: Making Printable Metadata Labels

Posted: 2016-01-24T11:37:53-07:00
by melrom
Hi - thank you -- one question based on this (sorry for being such a newb):

Is "rose" the name of the thumbnail in this suggestion? So, I should replace rose with P8240001_thumb.JPG?

Re: Making Printable Metadata Labels

Posted: 2016-01-24T12:11:58-07:00
by Bonzo
yes rose is an image built into Imagemagick hence the : after it. As you said replace it with your filename/

Re: Making Printable Metadata Labels

Posted: 2016-01-24T12:26:29-07:00
by snibgo
As Bonzo says. There are many ways of creating the required output. I give this example just to get you started. See http://www.imagemagick.org/script/comma ... p#annotate etc for explanations of the options.

Re: Making Printable Metadata Labels

Posted: 2016-01-24T12:39:49-07:00
by fmw42
If you are on a Mac, then snibgo's syntax needs to be changed, since he is on Windows. Syntax for Windows and Unix systems differ. See http://www.imagemagick.org/Usage/windows/

In Unix, his command would be:

Code: Select all

convert \
  -size 423x84 xc:White \
  \( rose: -resize 50x70^> \) \
  -gravity West -composite \
  -gravity NorthWest \
  -pointsize 10 \
  -annotate +60+15 "Title" \
  -annotate +60+50 "Author" \
  -pointsize 15 \
  -annotate +100+15 "Camera: OLYMPUS IMAGING CORP. StylusTough-3000 - Serial Number: ######" \
  out.png