photo editing

Owen Townend owen.townend at
Wed Apr 23 03:47:12 UTC 2008

On 23/04/2008, John Hubbard <ender8282 at> wrote:
> So not too long ago a friend of mine was challenged to eat an entire pie
> in an hour.  He succeeded and I have pictures of it.  I would like to
> insert a 'time left mm:ss' at the bottom corner of every image.  I would
> like to do this with bash scripts and/or java code.  My preference is
> bash but if something is too hard I am sure that I can figure out how to
> do it with java.  I need to know how to:
> 1) read exif time/date from a jpg file

Have a look at EXIFutils and/or `apt-cache search exif`

2) take all of those time/dates and calculate time left.  (I can easily
> do this with java but can it be done from a bash script?)

The  `date` command can manipulate date strings, it can take
arguments giving the format of your date string and return it in another

3) turn all of the time left strings into time left images

You could do this using php
Have a look at:
php5-cli using gd

4) super impose time left images over original images and save as new
> file.

If you use php as above, then this functionality is included .

Oh and to make things easier the images are not all the same
> orientation.  (Some are 3888x2592 others are 2592x3888)
> So if there is anyone out there who know how to do any of this from the
> command line, or with java code, I would appreciate it.

The exif tools can get you the dimensions and you could use that simply as
if ( $width > $height ) { /* Do horizontal image */ }
else { /* Do vertical image */ }

Some cameras save the images this way, others save them all in the same
orientation and include an orientation field. If yours are intermixed with
obvious (to a machine) way to tell their orientation then you could always
manually split them into two folders or naming schemes and operate on them

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ubuntu-users mailing list