file descriptions from photoshop elements?

  • Follow


A friend is moving to gimp from Photoshop Elements. He
has over 12,000 photographs in PE that all have a
description attached to the photo in PE. (apparently
saved with the photograph somehow).

a) Is there any way to extract all these descriptions
from where ever PE stores them, with the photo name,
to a text file?

b) From there, I'm predicting he would be interested
interested in writing a script that would step through
the photographs, add a white space at the bottom, say,
and insert the text there (not over the photograph).

Any suggestions or tips for learning how to do a) or b)
are welcome.

Thanks!
0
Reply jhy001 (36) 2/3/2010 10:02:46 PM

On 03/02/2010 23:02, John wrote:
> A friend is moving to gimp from Photoshop Elements. He
> has over 12,000 photographs in PE that all have a
> description attached to the photo in PE. (apparently
> saved with the photograph somehow).
>
> a) Is there any way to extract all these descriptions
> from where ever PE stores them, with the photo name,
> to a text file?

exiftool

>
> b) From there, I'm predicting he would be interested
> interested in writing a script that would step through
> the photographs, add a white space at the bottom, say,
> and insert the text there (not over the photograph).

imagemagick


-- 
Bertrand
0
Reply Ofnuts 2/3/2010 10:45:40 PM


On Wed, 03 Feb 2010 17:02:46 -0500, John wrote:

> A friend is moving to gimp from Photoshop Elements. He has over 12,000
> photographs in PE that all have a description attached to the photo in
> PE. (apparently saved with the photograph somehow).
> 
> a) Is there any way to extract all these descriptions from where ever PE
> stores them, with the photo name, to a text file?
> 
> b) From there, I'm predicting he would be interested interested in
> writing a script that would step through the photographs, add a white
> space at the bottom, say, and insert the text there (not over the
> photograph).
> 
> Any suggestions or tips for learning how to do a) or b) are welcome.
> 
> Thanks!

I don't know PE but AFAIK photoshop duplicates comments/captions in both 
exif and IPTC. Exif I can handle, IPTC is more complicated. Caveat: maybe 
read this
http://graphicssoft.about.com/od/pselements/f/preservetags.htm

First for (linux) Gimp users there is a python script which will write 
exif data under an image on a one-image-by-one basis. Windows users can 
install python, (but it is PITA to do so). for the script see:
http://forum.meetthegimp.org/index.php?topic=60.0
and get Exifdata.py linked in one of the posts.

But you will need more than this for batch work. As mentioned in another 
post ImageMagick is probably the way to go & it is command line & there 
is a learning curve.  
I keep a note of useful commands perhaps these can get you started.

Note: to save long file names put the image(s) in a convenient folder and 
run imagemagick commands from there.

1. To see what you have, the identify command outputs image info.

identify -verbose image.jpg

The output will be long and hopefully somewhere in it will be

Image: image.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
......
      exif:Copyright: COPYRIGHT, 2007
      exif:DateTime: 2010:02:04 10:50:39
      exif:DateTimeDigitized: 2008-01-01T00:00:21Z
      exif:DateTimeOriginal: 2008-01-01T00:00:21Z
...... plus a whole lot more

if you have these, next try

identify -format "%[EXIF:imagedescription]"  image.jpg
or
identify -format "%[EXIF:datetimeoriginal]"  image.jpg

2. To write some data to an image try (watch out for line wraps - all the 
commands should be on one line)

convert image.jpg -font Arial.TTF -pointsize 72 -fill white -annotate 
+100+100  %[exif:imagedescription] output.jpg

this puts some text in the top, left (+100+100), corner of output.jpg (on 
the basis that whatever the image size there will be a top left corner)

for more on adding text see:
http://www.imagemagick.org/Usage/annotating/
try
convert image.jpg -gravity South -background white -splice 0x18 -annotate 
+0+2 %[exif:imagedescription] output.jpg

the only problem with this is the text is very small, for larger text 

convert image.jpg -font Arial.TTF -pointsize 36 -gravity South -
background white -splice 0x42 -annotate +0+2 %[exif:imagedescription] 
output.jpg

to batch process images use a wildcard (*.jpg) as the input, Imagemagick 
will append a number to the original filename and with 12000 images don't 
mix file formats and I would break them up into smaller "lots"


best of luck

-- 
rich
0
Reply rich 2/4/2010 1:26:54 PM

Wow! Thanks Bertrand and Rich. Very helpful information. Last night
I installed exiftool and infomagick on my Mac. They both seem to
work. Since I'm doing this for a friend, I don't have a sample
image yet with the caption. (And I've taken note that PE only
writes this under special conditions).

I'm adept at Unix scripting, having used Unix since the 80's. So I
think I'm all set to be able to extract the information needed
to a file with exiftool, massage it, and pass it to infomagick's
convert with the appropriate parameters and options, in appropriate,
manageable sized, loops. I'll check out the other links provided
too. Maybe there is another way just as good or better.

Thanks!!!
0
Reply John 2/4/2010 4:43:47 PM

I don't yet have a Photoshop Elements file with a comment in it, so I'm
trying to learn using Gimp. I took a jpg, and in Gimp:
Image -> Image Properties -> Comment
I added a comment ("A Comment"), saved it in xcf (I think needed to retain
the comment), and then used exiftool and identify commands to examine the
file. The comment wasn't found in any field. Abbreviated outputs of the 
commands
I used and the results are below.

Shouldn't I see "A Comment" somewhere in these outputs?

Thanks!

% exiftool -a -u -g1 quaker_church.xcf
---- ExifTool ----
ExifTool Version Number         : 8.09
Warning                         : Skipped unknown 111 byte header
---- System ----
File Name                       : quaker_church.xcf
Directory                       : .
File Size                       : 5.1 MB
File Modification Date/Time     : 2010:02:04 18:53:05-05:00
File Permissions                : rw-r--r--
---- File ----
File Type                       : TIFF
MIME Type                       : image/tiff
Exif Byte Order                 : Little-endian (Intel, II)
---- IFD0 ----
Image Description               :
Make                            : NIKON
Camera Model Name               : E950
....
---- ExifIFD ----
Exposure Time                   : 1/224
F Number                        : 7.7
Exposure Program                : Program AE
ISO                             : 80
Exif Version                    : 0210
Date/Time Original              : 2005:11:20 14:35:43
Create Date                     : 2005:11:20 14:35:43
....
Exif Image Width                : 1600
Exif Image Height               : 1200
File Source                     : Digital Camera
Scene Type                      : Directly photographed
....

% identify -verbose quaker_church.xcf
Image: quaker_church.xcf
   Format: XCF (GIMP image)
   Class: DirectClass
   Geometry: 1600x1200+0+0
   Resolution: 72x72
   Print size: 22.2222x16.6667
....
   Properties:
     create-date: 2010-02-04T18:53:05-05:00
     modify-date: 2010-02-04T18:53:05-05:00
     signature: 
0fd66d14ea3d9e6f519602b7556ea9211a20380350ba29812ca1b12d2c782bef
   Artifacts:
     verbose: true
   Tainted: False
   Filesize: 5.123mb
....
0
Reply John 2/5/2010 12:41:41 AM

A Unix "strings" does find the comment:

% strings quaker_church.xcf
....
gimp-comment
A comment
gimp-image-grid
....

So apparently the field is "gimp-comment" but
the two tools don't "see" it?
0
Reply John 2/5/2010 2:43:34 AM

I guess I'm learning. I gimp saved the xcf back to a jpg and
running the tools on the jpg finds "A comment". And I found I
can get just the comment by:

% identify -format "%[comment]" quaker_church2.jpg
A comment

Now to see about putting the "A comment" into the picture
as a caption using the earlier tips.

Thanks!

exiftool -a -u -g1 quaker_church2.jpg
---- ExifTool ----
ExifTool Version Number         : 8.09
---- System ----
File Name                       : quaker_church2.jpg
Directory                       : .
File Size                       : 415 kB
File Modification Date/Time     : 2010:02:04 21:52:00-05:00
File Permissions                : rw-r--r--
---- File ----
File Type                       : JPEG
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Comment                         : A comment
Image Width                     : 1600
Image Height                    : 1200
....

identify -verbose quaker_church2.jpg
Image: quaker_church2.jpg
   Format: JPEG (Joint Photographic Experts Group JFIF format)
   Class: DirectClass
   Geometry: 1600x1200+0+0
   Resolution: 72x72
   Print size: 22.2222x16.6667
....
   Compression: JPEG
   Quality: 85
   Orientation: TopLeft
   Properties:
     comment: A comment
     create-date: 2010-02-04T21:52:00-05:00
     exif:ColorSpace: 1
     exif:ComponentsConfiguration: 1, 2, 3, 0
     exif:CompressedBitsPerPixel: 2/1
     exif:Compression: 6
     exif:DateTime: 2010:02:04 21:51:53
     exif:DateTimeDigitized: 2005:11:20 14:35:43
     exif:DateTimeOriginal: 2005:11:20 14:35:43
....
0
Reply John 2/5/2010 3:33:14 AM

On 2/4/2010 8:26 AM, rich wrote:
>
> the only problem with this is the text is very small, for larger text
>
> convert image.jpg -font Arial.TTF -pointsize 36 -gravity South -
> background white -splice 0x42 -annotate +0+2 %[exif:imagedescription]
> output.jpg

This works (with %[comment]). But two issues:

1. I get the warning:
convert: unable to read font `Arial.ttf' @ annotate.c/RenderType/1075.
(I'm on a Mac with Snow Leopard).

I looked, and Arial.ttf is in the Mac's Library Font area. But I don't
know how these programs try to access them. (yes, I tried uppercase
TTF first, it failed the same way).

2. With a short comment, it comes out centered below the picture just
fine. But if the comment is very long, without line feeds, the ends
are lost. I can fix that by putting line feeds in every so many
characters (I just checked, line feeds can be put in the comments
and they extract as they should), but then only the bottom line
is below the photograph, the others are in it. If there are N
lines, I assume rewriting the -annotate +0+2 line would make it
all appear below the photo. What should I rewrite it to?
Or is there a more elegant way to get all of a long comment below
the photo?

Thanks!
0
Reply John 2/5/2010 4:26:22 AM

On Thu, 04 Feb 2010 23:26:22 -0500, John wrote:

> On 2/4/2010 8:26 AM, rich wrote:
>>
>> the only problem with this is the text is very small, for larger text
>>
>> convert image.jpg -font Arial.TTF -pointsize 36 -gravity South -
>> background white -splice 0x42 -annotate +0+2 %[exif:imagedescription]
>> output.jpg
> 
> This works (with %[comment]). But two issues:
> 
> 1. I get the warning:
> convert: unable to read font `Arial.ttf' @ annotate.c/RenderType/1075.
> (I'm on a Mac with Snow Leopard).
> 
> I looked, and Arial.ttf is in the Mac's Library Font area. But I don't
> know how these programs try to access them. (yes, I tried uppercase TTF
> first, it failed the same way).
> 
I have (had) the same problem here on Mepis8 (Debian) and thought it was 
because I use a font manager and do not have any 'local' fonts that 
normally show as such.
Solved it by copying the Arial.TTF (the regular windows one from my WINE 
installation) file to the same folder from where I run Imagemagick. I 
suppose it needs to be in the Imagemagick path somewhere.

> 2. With a short comment, it comes out centered below the picture just
> fine. But if the comment is very long, without line feeds, the ends are
> lost. I can fix that by putting line feeds in every so many characters
> (I just checked, line feeds can be put in the comments and they extract
> as they should), but then only the bottom line is below the photograph,
> the others are in it. If there are N lines, I assume rewriting the
> -annotate +0+2 line would make it all appear below the photo. What
> should I rewrite it to? Or is there a more elegant way to get all of a
> long comment below the photo?
> 
Don't know about line wraps, The splice switch changes the depth of the 
'bottom lines' to accommodate larger text size.
also maybe change the gravity values, see the Imagemagick web site.
GRAVITY is the direction you wish to move,
NW, NE, SW, SE, N, S, CENTER!

LOCATION is where you put numbers that determine the placement of your 
text
RIGHT, LEFT, NORTH, SOUTH!


-- 
rich
0
Reply rich 2/5/2010 8:55:54 AM

On Thu, 04 Feb 2010 22:33:14 -0500, John wrote:

> I guess I'm learning. I gimp saved the xcf back to a jpg and running the
> tools on the jpg finds "A comment". And I found I can get just the
> comment by:
> 
> % identify -format "%[comment]" quaker_church2.jpg A comment
> 
> Now to see about putting the "A comment" into the picture as a caption
> using the earlier tips.
> 
> Thanks!
> 
I hardly ever use use exif properties but I recall (I think) that 
ImageMagick can 'lose' this data.  A search of the ImageMagick forums 
might give some info.

I do know that the Gimp 'Comment' from image properties is different from 
the exif:imagedescription that might be included using PS. From a PS jpg 
edited in gimp to add a comment.

The offsets are different - using exifprobe.
@0x00000bc=188     :        ImageDescription            = 'This is in the 
description\0'
@0x000235f=9055    :    <JPEG_COM> length 22: ''this is a gimp image''



-- 
rich
0
Reply rich 2/5/2010 9:34:27 AM

My friend has now posed a new wrinkle to the original question
that you guys helped me figure out.

That is, is it possible for Gimp to see and edit ImageDescription
and CaptionWriter comment properties put in by Photoshop Elements?

Gimp's Image -> Image Properties -> Comment only "sees" the
"comment" field below.

Imagemagick's identify shows these fields as:
% identify -verbose testfile.jpg
   ...
   Properties:
     comment: This comment was added in Gimp.
     create-date: 2010-02-07T11:16:45-05:00
     ...
     exif:ImageDescription: This is a test comment from Photoshop Elements
     ...
     photoshop:CaptionWriter: And this is a caption put in via Photoshop 
Elements

Thanks!
0
Reply John 2/7/2010 4:28:13 PM

10 Replies
209 Views

(page loaded in 0.562 seconds)


Reply: