Thanks, Dan. I just noticed that my usual image manipulation tool - PaintShop Pro - will tell me the EXIF information as well but it doesn't look very useful for what interests me. There is an "orientation" but it doesn't seem to differ between photos taken with different orientation - at most it distinguishes between landscape and portrait (which you could figure out based on the dimensions of the photo).
For my purposes, I'm satisfied with this version of Raul's code: bumpRO=: (+ 1e4 * 3333&> * 6667 <: >./)"1 NB.* bumpRO: bump rolled-over seq #s. bumpRO 9997 9999 1 2 9997 9999 10001 10002 bumpRO 6997 6999 1000 2000 6997 6999 11000 12000 bumpRO 4997 4999 5000 5002 4997 4999 5000 5002 bumpRO 3332 3334 5000 6666 6668 NB. Not clear what the right answer is here. 13332 3334 5000 6666 6668 On Mon, Jan 19, 2009 at 1:27 PM, Dan Bron <[email protected]> wrote: > Devon wrote: > > I'm interested in what information may be included in the > > EXIF image header, as well as other timestamp information. > > Does anyone have code to read this header and the other timestamps? > > According to Wikipedia, the EXIF data structure is old and causes a lot of > pain. So while we could write an EXIF parser in J, I'd recommend using a > battle tested version that's already worked out all the kinks. > > A quick google turns up ExifTool: > > > http://www.sno.phy.queensu.ca/~phil/exiftool/<http://www.sno.phy.queensu.ca/%7Ephil/exiftool/> > > It's Perl-based, and hence cross-platform. Here's an example of how you > could use it to extract the original photo time from an image file: > > require 'task' > enquote =: '"', ,&'"' > makeTable =: (({.~ ;&:deb (}.~ >:)) i.&':');._2 > lookupTag =: ({."1@:[ i. <;._1^:(0=L.)@:]) { a: ,~ {:"1@:[ > > NB. If you don't have image3 installed, just pick another JPG > imgFn =: enquote jpath '~addons\media\image3\atkiln.jpg' > > NB. Obviously point this at wherever you download exiftool > exiftoolFn =: enquote jpath '~tools\img\exiftool(-k).exe' > > NB. The EXIF data extracted from the img > imgExif =: makeTable toJ spawn exiftoolFn,' ',imgFn > > NB. A tag of interest > imgModDate =: imgExif lookupTag <'File Modification Date/Time' > > imgModDate > +-------------------------+ > |2007:01:15 04:26:33-05:00| > +-------------------------+ > > Unfortunately I've found that the embedded EXIF 'File Modification > Date/Time' tag is tied to the filesystem's timestamp, so it doesn't solve > your problem. On the other hand, I tried the above on some of my personal > photos, and I found a tag named 'Date/Time Original' which doesn't ever > change. But since it's not present on the image3 example image, that means > that EXIF tags may not be consistent, and so are unreliable, so you're back > to square one. > > But I hope this gets you a little further. > > -Dan > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
