<br><div><span class="gmail_quote">On 23/04/2008, <b class="gmail_sendername">John Hubbard</b> <<a href="mailto:ender8282@yahoo.com">ender8282@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
So not too long ago a friend of mine was challenged to eat an entire pie<br> in an hour.  He succeeded and I have pictures of it.  I would like to<br> insert a 'time left mm:ss' at the bottom corner of every image.  I would<br>
 like to do this with bash scripts and/or java code.  My preference is<br> bash but if something is too hard I am sure that I can figure out how to<br> do it with java.  I need to know how to:<br> 1) read exif time/date from a jpg file</blockquote>
<div><br>Have a look at EXIFutils and/or `apt-cache search exif` </div><br><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
 2) take all of those time/dates and calculate time left.  (I can easily<br> do this with java but can it be done from a bash script?)</blockquote><div><br>The  `date` command can manipulate date strings, it can take<br>arguments giving the format of your date string and return it in another format.<br>
</div><br><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
 3) turn all of the time left strings into time left images</blockquote><div><br>You could do this using php<br>Have a look at:<br>php5-cli using gd <a href="http://au.php.net/gd">http://au.php.net/gd</a><br><a href="http://kore-nordmann.de/blog/image_creation_with_php_texts.html">http://kore-nordmann.de/blog/image_creation_with_php_texts.html</a><br>
</div><br><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
 4) super impose time left images over original images and save as new<br> file.</blockquote><div><br>If you use php as above, then this functionality is included .</div><br><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
 Oh and to make things easier the images are not all the same<br> orientation.  (Some are 3888x2592 others are 2592x3888)<br> So if there is anyone out there who know how to do any of this from the<br> command line, or with java code, I would appreciate it.</blockquote>
<div><br>The exif tools can get you the dimensions and you could use that simply as<br>if ( $width > $height ) { /* Do horizontal image */ }<br>else { /* Do vertical image */ }<br></div><br>Some cameras save the images this way, others save them all in the same <br>
orientation and include an orientation field. If yours are intermixed with no<br>obvious (to a machine) way to tell their orientation then you could always<br>manually split them into two folders or naming schemes and operate on them<br>
individually.<br> <br>cheers,<br>Owen.<br></div><br>