Modify "date modified" on images to match "EXIF date"?

heya,
This isn't strictly a Arch Linux related question, but the community on here is fairly knowledgeable, and it's a scripting question .
I have a bunch of images in a directory, taken by my old BB 9700 phone.
The names of these are a bit mixed up, because BB's tend to randomly reset the increment counter - the files are named something like "IMG00001-20100216-1319", but I've got "IMG00001-20100418-1220", for example, as well.
When I browse these with Dolphin (KDE File Manager), I can choose to sort them by name, or by date. However, this is date modified, not the EXIF date. On Windows, Explorer lets you sort either by Date Modified, or by "Date Taken", which I assume is the EXIF date.
It's a bit annoying that Dolphin doesn't let you sort by EXIF date, but that's another issue. On my phone (Nexus One), the Android Gallery application also seems to sort by Date Modified, not the EXIF date.
My question is, is there any way to say, run "touch" on the files, and get the date modified to match the EXIF date? Any programs or scripts you know of that can do this?
Cheers,
Victor

Well... you can write a quick 'n dirty script in you favorite language for example zsh+python+awk
$ for i in *.jpg; do touch -d "$(identify -verbose $i|awk '/exif:DateTimeOriginal:/ {print $2,$3}'|python -c 'from time import *;from sys import stdin; print strftime("%Y-%m-%d %H:%M:%S", strptime(stdin.read(), "%Y:%m:%d %H:%M:%S\n"))')" $i;done
(This works on bash+python+awk too, I think). This works for me because my photos have a exif filed with 'DateTimeOriginal' run identify -verbose in your images and select the correct field. My exif field have a format '%Y:%m:%d %H:%M:%S' if this is not your case change this.
EDIT For this simple date format case you can use only awk
for i in *.jpg; do touch -d "$(identify -verbose $i|awk '/exif:DateTimeOriginal:/ {print $2,$3}'|awk -F : '{printf("%s-%s-%s:%s:%s", $1,$2,$3,$4,$5)}')" $i;done
Last edited by kazuo (2010-06-23 01:36:28)

Similar Messages

  • Batch Change "Date Modified" to match Exif Data After iPhoto Export

    Among several other posts about similar situations, I have found none that directly and simply resolve this issue.
    My wife imported a bunch of photos into iPhoto directly, but I wanted them in a folder on the hard drive.
    I pulled them out of iPhoto into a folder, then deleted the ones in iPhoto so that I could sort them and reimport.
    I then realized that the photos all now showed the date they were imported into iPhoto as their created/modified dates, which makes it impossible to easily sort them by the date of the pictures.
    I checked the Exif data, and it has preserved the correct creation date event though checking "info" on the pictures shows create date the same as modified the same as iPhoto import.
    Is there an easy way to batch change an entire folder of pictures to change the Created/Modified dates to match the Created date from the Exif data?
    The only other similar posts had answers that reccomend a piece of software that does not seem to actually do this, and one that suggests some sort of confusing script that I don't really understand.
    Please help - I have a bunch of family photos that I really need to fix.

    shootShifter helps to redate and rename complete folders of images based on the EXIF data or Finder dates.
    So it will do batches.
    I also believe that exporting the Original (File -> Export: Kind Original) will make all of this unnecessary.
    I don't like having them only in iPhoto so I organize the originals into folders by choronological event then import them so I have copies outside the iPhoto library to put elsewhere.
    You understand that you're using twice the disk space there, right? And that it's quite unnecessary. All iPhoto does is to put them in folders too. Have you looked inside the iPhoto Library ever?
    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed. Your photos are in the Masters folder.
    Standard warning: Don't change anything in the iPhoto Library Folder via the Finder or any other application. iPhoto depends on the structure as well as the contents of this folder. Moving things, renaming things,, deleting them or otherwise making changes will prevent iPhoto from working and could even cause you to damage or lose your photos.
    Regards
    TD

  • Batch change file date to match exif date

    Hi All-
    I recently got a mac pro. Upon importing my photos to iPhoto, the file date for each is set to the date of the import. When using the mac photo screensaver, the date that shows up for everything is the import date, rather than the date the photo was taken.
    Is there any way to batch change the pictures so that the file date matches the date the picture was taken?
    (Or, a way to have the screensaver use that date
    Thanks,
    -jamie

    Interesting, but here is what I found out. I was annoyed because when I sucked in about 1000 JPGs from my camera's memory stick, and then I copied them to my Windows boxen, the file dates were wrong. I was surprised that there isn't an easy way to do this... until your post!! Thanks. *APPLE, Please fix the way "Originals" are stored during iPhoto import*, since something is wrong here. The file dates stored on my memory stick should have been used not the moment I clicked import in iPhoto.
    So I moved my jhead to /usr/bin and gave it root ownership and 755 permissions.
    All of the pictures seem to be three deep here:
    cd ~/Pictures/iPhoto\ Library/Originals
    ls -lsGrt /*/.jpg
    But that is only a small fraction of mine. Most end in .JPG
    ls -lsGrt /*/.JPG
    So here is the commands to do the correction of the file date and time. You don't need the find command or that script, although you might need to snoop around and make sure all of your files are here and not any deeper or in some other location. but this should be harmless to run as long as you want to alter every file date.
    jhead -ft /*/.jpg
    jhead -ft /*/.JPG
    And that pretty much does it. I don't see any images elsewhere that were brought in by iPhoto 6 on my machine. I looked for MPG files but I don't have any. This is from a video recording camera, so I don't have any MPGs.
    So jrsmobile, my mileage varied a lot, since your method missed about 95% of my photos!!

  • Image attachments and EXIF data

    Hi,
    It appears that when I use the iPhone to save attachments to Photos, it renames them and removes their EXIF data. So for now I have to use the MacBook and put them into iPhoto from there.
    Is this a known bug with Apple or should I report it? Or am I doing something wrong?
    Thanks,
    :-Joe

    How a message is forwarded is up to the mailer doing the forwarding.
    Some mailers will attach the entire original message as an attachment,
    which should preserver the images. Some mailers will include the text
    of the original message in the forwarded message, which will lose the
    images. Either way, it's not something you get to control.

  • Valid to dates on KONH table not matching the dates in A* tables- SD pricin

    We have an issue in our KONH/A* tables. Please review the data below:
    A583: ( This is for a Z condition type ZCTR)
    MANDT KAPPL KSCHL  VKORGAU MATNR                DATBI      DATAB      KNUMH                                                                               
    028   V     ZCTR   0006    000000000000031886   03/31/2006 01/01/2006 0071519869
    028   V     ZCTR   0006    000000000000031886   06/30/2008 03/02/2008 0071519869
    KONH
    MANDT KNUMH  DATAB      DATBI    
    028   0071519869 01/01/2006 12/31/9999
    If you look in VK13, for this ZCTR record/material you will see the following dates.  We can see that two records have the same KNUMH , is this a SAP bug?
    Also what is the difference in dates in KONH and A* tables ? I see that the valid from dates match but the valid to date in KONH is the valid to date of the last record in the A table.                                                                           
    MANDT KAPPL KSCHL  VKORGAU MATNR                DATBI      DATAB      KNUMH                                                                               
    028   V     ZCTR   0006    000000000000031886   03/31/2006 01/01/2006 0071519869
    028   V     ZCTR   0006    000000000000031886   12/31/2007 03/13/2007 1032266853
    028   V     ZCTR   0006    000000000000031886   03/01/2008 01/01/2008 1061605348
    028   V     ZCTR   0006    000000000000031886   06/30/2008 03/02/2008 0071519869
    028   V     ZCTR   0006    000000000000031886   12/31/9999 07/01/2008 1093084511

    Thanks for putting so much thought into this, but I still fail to see the advantage/reason of maintaining the original dates in KONH if the new dates are prior to the original date ( in case of valid to). We always have the change log to determine the origibal dates with which the record was created.
    Thanks for all the responses.
    The duplicate KNUMH is causing the issue for us:
    A583: ( This is for a Z condition type ZCTR)
    MANDT KAPPL KSCHL VKORGAU MATNR DATBI DATAB KNUMH
    028 V ZCTR 0006 000000000000031886 03/31/2006 01/01/2006 0071519869
    028 V ZCTR 0006 000000000000031886 06/30/2008 03/02/2008 0071519869
    As you can see two records have the same KNUMH. We were trying to run archiving for condition records and came across an issue.
    As there is a duplication of KNUMH ( which is wrong) the program does not pick up the 2006 record . This is because it considers the 2008 record to be compared against the residency date and skips the older one too. We tried changing the validity dates of the 2008 record to an older date so that both are within the residency date. This is how the records looks now :
    028 V ZCTR 0006 000000000000031886 06/30/2005 03/02/2005 0071519869
    028 V ZCTR 0006 000000000000031886 03/31/2006 01/01/2006 0071519869
    KONH
    Cond.record no. Usage Table Application Condition type Valid From Valid To
    0071519869 A 583 V ZCTR 03/02/2005 12/31/9999
    Once we did this the archiving program was able to pick this record up.
    Has any one faced this issue before? Is this a known SAP issue ? I could not find any OSS for this.
    Edited by: harikrishnan balan on May 28, 2009 11:03 PM

  • Modify EXIF date?

    iPhoto '11 (9.2.2) lets me set a date for photos, but apparently this new date is known only to iPhoto. Even if I check the "Modify original files" box when I set the date, the original date of the photo in its EXIF data is unchanged. This can be a problem, as when exporting photos or uploading photos to Flickr, which either can't see or ignores the  date set by iPhoto and uses the date in the EXIF data instead. Is there a way to change the date in the EXIF data?
    I saw one post (from 2007) that said checking the "Modify original files" option WOULD change the EXIF date and another post that described changing individual photo dates through the Info mode. Neither works for me. Is that a bug? I have to use Batch Change to modify the date for even a single photo, and even if I do that with "Modify original files" checked, the EXIF data is not changed.

    Sorry if I'm not being clear. Here's a summary:
    1. A photo is taken in August of 1966 and developed as a slide.
    2. Last summer the slide is digitized: EXIF date is 6/7/11.
    3. A month or so later I add the photo  to iPhoto, which still reports the date as 6/7/11.
    4. On 3/7/12, I edit the photo in iPhoto and use the Batch Change feature to set the date to when the photo was actually taken: 8/1/66. As expected, iPhoto Info now shows the date as 8/1/66.
    5. On 3/12/12 I use the Flickr uploader in iPhoto to upload the photo to my Flickr set. Flickr reports the date of the photo as 6/7/11.
    6. Today, 3/21/12, I look at the file information for the photo in two places: Finder and Tools Inspector in Preview. Both of these places report the same Created and Modified date: 3/7/12 (the date I edited the photo in iPhoto).
    So, what is unexplained is:
    1. When I change the date in iPhoto, why does the file creation date and modification date change to the present day instead of the date I set?
    2. When I upload the photo to Flickr, why does the creation date revert to the date when the image was first digitized from the slide?
    And, of course, my only goal is that the date I set in iPhoto show up in Flickr when I upload it there.

  • Can exif data be changed in photoshop

    I am engaged in a nasty lawsuit and now I have a question. So I hope you can help me further.I have a question about adobe Photoshop CS2.
    I have added in the annex 2 pictures of properties of a photo. The photo is on 1-10-2010. All the exif data from the camera stand in it too (see CANON EOS 350 d still camera data). Now my question, if you the picture edited in Adobe Photoshop CS2 can then also the date of recording of the photo? I.e. this date change? Continue then the exif data exist, or disappear than the camera data if one adjusts this date in Adobe Photoshop and you only see the "updated" date taken. I have always understood, that if one changes, the date of recording the exif camera data disappear from the picture. In this case, the exposure time, the camaramodel etc.. I understand that you have a create date (exif) original (recorded)
    to illustrate the RAW data of the photo:
    <exif:DateTimeOriginal>2010-10-01T11:39:18</exif:DateTimeOriginal>
    <exif:DateTimeDigitized>2010-10-01T11:39:18</exif:DateTimeDigitized>
    and a create date and modify date (date of operation) in photoshop.
    To illustrate the RAW data from the same photo:
    <xmp:ModifyDate>2010-11-30T20:09:55+01:00</xmp:ModifyDate>
    <xmp:CreateDate>2010-10-02T20:29:54+02:00</xmp:CreateDate>
    <xmp:MetadataDate>2010-11-30T20:09:55+01:00</xmp:MetadataDate>
    <xmp:CreatorTool>Adobe Photoshop CS2 Windows</xmp:CreatorTool>
    In this case are the exif data for the original date of recording of the camera and are the xmp data for the dates of editing in Photoshop?
    Can anyone confirm this, or is it different story. In advance, thank you very much for the effort, I would very much benefit from

    Thanks, where can I find these 3 dates, when looking at the photo (picture). Because above I have an </exif:DateTimeOriginal>2010-10-01T11:39:18 and then I have a
    <xmp:ModifyDate>2010-11-30T20:09:55+01:00</xmp:ModifyDate>
    <xmp:CreateDate>2010-10-02T20:29:54+02:00</xmp:CreateDate>
    Are these the 3 dates you meant?

  • Missing exif data

    I'm not really sure how this works but... I need an applescript that will
    (1) search a directory structure,
    (2) find the image files that are missing the exif date,
    (3) write the date created to the missing exif date field
    (4) rename the file using the created date
    I have several thousands of images that are missing the exif information. Any assistance would be appreciated...
    Thanks

    How are you trying to install it? There are two methods the easiest is to download the DMG file. Assuming you are doing the DMG file install are you saying that the installer hangs?
    I don''t install using the DMG file so I can't say if there are problems with it.
    When you get it running I do have a question for you:
    You state that you have image files missing the Exif date information and that you want to add it back
    (3) write the date created to the missing exif date field
    but where are you getting the date created from if it is not in the file? Are you saying you want to use the file creation date? You realize that is not always the same as the image creation date, right?
    4) rename the file using the created date
    So you want to rename the file using the file creation date (which is now also the exif date)?
    regards

  • Exif data info

    I am unsure about the proper place to post this question,so i picked this forum ? Does anyone know if file exif data contains info that can prove a specific camera or lens was used to produce an image?  for instance could i prove one nikon d300 shot an image verses another d300. thanks for any help rendered.

    Donald Reese wrote:
    …Now i am just hoping there is not some sneaky way to change exif within a source file…
    Alas, there is, Donald. 
    There are a number of utilities that can mess around with the Exif data.
    Also, a simple method used by thieves bent on stealing an image is to open one of the images (file A) shot by their camera, open it in Photoshop, then open the image they want to steal (file B).  On file A, they double click on the background to unlock it, drag the layer(s) from file B on top of file A, and delete the original now-unlocked background.  Now they have the stolen image with the EXIF data of their own shot.  The last steps are to go to the Layer menu in Photoshop > New > Background From Layer and Save the file.
    Such is the world we live in. 
    A raw image is more difficult to forge.
    Wo Tai Lao Le
    我太老了

  • Exif data lost?

    whenever i work with RAW files in Aperture, i always loose the exif data. Even the camera make does not show up when i post to flickr. I have all updates for aperture.
    My cameras are Rebel XT and Leica DLux3

    what does the preset that you are using to export the images say about exif data ???
    there is a checkbox that includes or strips the metadata for presets ...
    check that first ...

  • Why does Bridge always sort images by rating instead of by date modified?

    Why does Bridge always sort images by rating instead of by date modified?
    This drives me bonkers.  Everytime I look for an image I've been working on, I go to Bridge and I'm always presented with the images sorted by rating instead of by date.
    Then I click on the microscopic sized, extremely tiny arrow that allows one to choose 'sort by date modified' and I resort them to find the file I need.  So that's always 3 extra clicks to find the image.
    WHY can't Bridge sort images by date modified and STAY that way every time I come back?
    Thanks for any help.
    I know I could just keep the recent files rated the highest, but still, I'm wondering if there's a way to make it work the way I'd like it to work?
    jn
    p.s.  Note to Adobe: Please make the selection button for sorting images arrow larger than a fraction of the size of the period at the end of this sentence.  Thanks.

    WHY can't Bridge sort images by date modified and STAY that way every time I come back?
    By default it does stay at the latest selected sort order so this could mean it is due to your install.
    First of all try to reset the preferences for Bridge, hold down option key while restarting Bridge and choose reset preferences. This sets it all to default. First try if the problem is solved then set prefs again to your own custom wishes.
    Also check and repair permissions for the OSX itself (Apple has disk utility in the utility folder for this job, and there are other 3th party applications)
    And be sure to have the latest update for Bridge. (Bridge CS5 should be 4.0.5.11)
    In addition to the method Tai Lao pointed you already to there is a third option, use right click mouse button in content window and the pop up menu has also the sort option at the bottom of the row

  • Does Adjust Date & Time Modify EXIF data?

    If I use the adjust date and time does it modify the exif data in the original photo, so if I export the photos elsewhere it will preserve these edits? I was using Picasa and fixed the date and time on a few photos only to find them back to 1/1/2002 when I imported my photos to iPhoto

    I just saw this checkbox today and hoped it meant that. I've really wanted this feature for a long time now.

  • In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp (EXIF date fields as

    I tryed to sort my pictures with buying Apps and following suggestion from apple, but without any success. In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp.

    Not a problem when using iPhoto on a Mac, which the transfer of photos is primarily based on - not manually managing photo storage as seems to be common with Windoze.
    The same should be available with a supported photo management app on a PC.
    http://support.apple.com/kb/HT4221

  • IPhoto batch change is choosing date modified rather than date created

    Hello all,
    I have a large number of MOV files which I have imported into iPhoto. I want to batch change them all, renaming them to the footage date and time.
    iPhoto has chosen the date last modified rather than date created to rename them to. When in Finder and open Inspector, it does have the correct date created.
    I can adjust date and time and tick the box to modify the original file for each one but given the quantity I have to do, I would rather the batch change pick up on the date creted. 
    Any ideas on how I can get iPhoto to do this correctly?
    I have spent some time searching online and haven't had any luck so far.
    I am using iPhoto 11 v.9.4.3 if it makes a difference.
    Thanks all
    Andrew

    iPhoto can only change the date on image files which have EXIF fields.  Movie files don't have EXIF fields so you'll need to do the job outside of iPhoto with an application that can change the file created date like  A Better Finder Attributes 5: Mac OS X Batch Date Changer for EXIF Photos, Files and Folders
    or
    File Date Changer: Change file creation and modification dates and times for Mac OS X files
    OT

  • Need help with EXIF date on raw images

    I have just over 100 images (taken by 2nd shooter) that have the wrong EXIF date (JPEG and raw).  They were taken with a 2nd camera that was off by +15hrs 57min.
    There are many programs that will easily edit the EXIF date/time on the JPEGs, but they don't work with the raw images.
    I've read that Lightroom can compensate for incorrect dates upon import, but after searching, I can't find any information on how to do it.  Can someone please help?

    I got EXIFTool working and solved my problem down to the exact second.
    I was able to sync the times to within one second, based on one one particular event.  One shot, taken with camera 1 was right before a handshake, while both people were extending hands, the other shot, with camera 2 (wrong EXIF date) was the actual handshake.  I used this information to determine that camera 2 was 15hours 57minutes 18seconds fast.
    Using EXIFTool GUI, I modified the date/time shift to decrement 15hours 57minutes 18seconds for all images from the second camera (both raw and JPEG).  After this was complete, I checked the times, and the two frames (before and during the handshake) were only one second apart, and in correct sequence.
    I imported the images from both cameras into Lightroom and had it rename the images based on time down to the second (YYYYMMDDHHMMSS-filename).
    Now everything is great!

Maybe you are looking for