Add a timestamp to photos by reading the file date...?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Add a timestamp to photos by reading the file date...?
I'm working with my photos, and none of them have a timestamp on the picture automatically added by the camera. (Good when using as desktop backgrounds; bad when printing!)
Is there a program that can add a timestamp to an image by reading the EXIF info, or the file creation date? Preferably native for GNU/Linux, preferably free/open-source. (I'm using Ubuntu 7.04 Feisty.)
I did a quick google search on "timestamp images", and it led me to TimeToPhoto: http://avpsoft.com/products/timetoph...imetophoto.com
Something like that would be nice. It seems to add the date to the corner of the picture.
Do you want to add the date to the exif info or actually to the image itself? If the later, look at the ImageMagick package. The ImageMagick home page may have a tutorial on adding text to images.
The ImageMagick home page may have a tutorial on adding text to images.
It does in fact have such a tutorial. You could use the output of the exif command (the small utility that comes from the same people who make libexif) along with Imagemagick’s convert to get the desired result. For example:
Code:
#!/bin/sh
# Script to add date & timestamp to lower left hand corner of a jpeg image
# (where the date and timestamp is obtained from EXIF data if available)
# First (and only) argument is the name of the file, and the output is in
# a file whose name is derived from the original name, stripped of the .jpg
# extension, with "_anno.jpg" added
TEXT=$(exif -mt "Date and Time" $1)
[ -z "$TEXT" ] && exit 1
OUTPUT="$(basename "${1}" ".jpg")_anno.jpg"
convert $1 -fill white -undercolor '#00000080' -gravity SouthWest \
-annotate +0+5 " $TEXT" "$OUTPUT"
Of course you could tweak some things (e.g., text color, size or relative size, location, date format, etc.), but it gets the basic job done.
Last edited by osor; 09-14-2007 at 01:54 PM.
Reason: typo in script
Do you want to add the date to the exif info or actually to the image itself?
I want to add the date to the image itself.
Quote:
Originally Posted by osor
It does in fact have such a tutorial. You could use the output of the exif command (the small utility that comes from the same people who make libexif) along with Imagemagick’s convert to get the desired result.
Thanks; I'll have a look at it. I'll be naughty, however, and ask you a question without trying it -- Does it matter whether the pictures are portrait or landscape? Or must they all be landscape?
Thanks all, I'll look at the tutorial later and reply back.
Thanks; I'll have a look at it. I'll be naughty, however, and ask you a question without trying it -- Does it matter whether the pictures are portrait or landscape? Or must they all be landscape?
Thanks all, I'll look at the tutorial later and reply back.
I don't know, but it may make a difference what the exif orientation info says.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.