Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • May 25, 2017, 01:25:03 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Problem Solved. (batch change of jpg 'created time')  (Read 366 times)

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,192
    • View Profile
    • Donate to Member
Problem Solved. (batch change of jpg 'created time')
« on: May 18, 2017, 05:36:03 PM »
When I moved my files to this computer (x64 Windows 10 Home), I accidentally & unfortunately used a program that has erased almost all original info   and changed every jpg "Created Time". This is sad to me, because no matter how trigger happy I might be, I did not shoot 2150 pictures within a couple of minutes!

I realize I cannot recreate the original info or saved / created time, but I know I can copy each picture's "Last write"-time to also become its "Created"-time - and such a compromise is very okay in the situation (I don't care about camera info in general, other than when & where was the picture taken?) However, for now I can only do this one picture at a time - if I try to do it with more files, they have so far copied the same "time", or caused other problems. I need help to do this the proper batch way!

ChangeTime.jpgProblem Solved. (batch change of jpg 'created time')


Do 'you' know of a program that can do this? Or can & will 'you' write a script to make it happen?   
« Last Edit: May 19, 2017, 10:02:40 AM by Curt »

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,137
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #1 on: May 19, 2017, 02:19:27 AM »
For Each JPG in folder --- Set "Created"-time from "Last write"-time


You can use PowerShell for that.

(First have a backup)




I will do it step by step for the learning effect:

Step1
Launch PoSh and change to your folder.

Step2
List the file(s) with Get-ChildItem and utilize Get-Member to see the object properties
(I have added select -First 1| because it is enough to see that info once only)

Get-ChildItem *.jpg | select -First 1 | Get-Member
(Short: ls *.jpg|gm)

You will see among others
CreationTime              Property       datetime CreationTime {get;set;}
LastAccessTime            Property       datetime LastAccessTime {get;set;}
LastWriteTime             Property       datetime LastWriteTime {get;set;}


Step3
Now lets see what that properties will get us
Get-ChildItem *.jpg | ForEach-Object{$_.CreationTime ; $_.LastWriteTime}
Donnerstag, 20. April 2017 16:25:27
Mittwoch, 19. Oktober 2005 01:18:56


Step4
Set Creation time from LastWriteTime
Get-ChildItem *.jpg | ForEach-Object{$_.CreationTime = $_.LastWriteTime}


Step5
Test, like in Step3
Get-ChildItem *.jpg | ForEach-Object{$_.CreationTime ; $_.LastWriteTime}
Mittwoch, 19. Oktober 2005 01:18:56
Mittwoch, 19. Oktober 2005 01:18:56



For you it's enough to perform Step4.
In short syntax:
dir *.jpg | %{$_.CreationTime = $_.LastWriteTime}

Or work on the first few only for testing purpose:
dir *.jpg |select -First 3| %{$_.CreationTime = $_.LastWriteTime}


Use '-Recurse' to work in sub folders too:
dir *.jpg -Recurse | %{$_.CreationTime = $_.LastWriteTime}



HTH?  :D

GCI is short for 'Get-ChildItem'
DIR and LS are aliases for 'Get-ChildItem'


.
« Last Edit: May 19, 2017, 02:27:10 AM by AbteriX »

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,192
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #2 on: May 19, 2017, 03:45:08 AM »
1) I have never before seen Power Shell or Power Shell ISE. So no matter how grateful I might be that you're trying to help me, AbteriX, I have absolutely no idea what you just told me!  :-[

2) Power Shell will not navigate to C:\Users\Kurt\Pictures, but will strictly open at C:\Users\Kurt and go nowhere else. Any attempt to navigate elsewhere has so far resulted in "ObjectNotFound" & "CommandNotFoundException" or similar. So, back to basics: How do I navigate Power Shell?  :tellme:
« Last Edit: May 19, 2017, 08:01:56 AM by Curt »

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,623
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #3 on: May 19, 2017, 04:12:17 AM »
Curt, [edit] see also next post [/edit] this old but might be of help -- I have used another app and posted about it here but could not find it :-(

revisiting this (correcting created date of photos) -
this about correcting the date in the Exif info if that incorrect.

From the current newsletter (Nov.6th 2009) from Imaging Resource. I added a link for the recommended app in the quote:-
Quote
camera manufacturers record it in the Exif header of their image files in several places. The DateTimeOriginal, CreateDate and ModifyDate tags all record it, for example. The trick is to reset all three on a new image.

ExifTool can do that with one simple command. There's a Windows version and a Mac version. The simplest way to use the utility is from the command line (Terminal on the Mac).
[...]
   exiftool -AllDates-=1 *
Full article: http://www.imaging-r...v11/20091106.htm#adv

I do have a GUI (portable) for that:
the only info in the about box is:
---------------------------
Information
---------------------------
ExifToolGUI v3.42 by Bogdan Hrastnik
Freeware interface for Exiftool
ExifTool by Phil Harvey v8.35
jhead.exe=missing,  jpegtran.exe=missing
---------------------------

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,623
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #4 on: May 19, 2017, 04:14:40 AM »
this the one I used for the job: again old, but might still do the job:

here are two more tools that will be useful in this task.

http://www.sentex.net/~mwandel/jhead/
http://jpgtime.learsy.com/
that Learsy one is a thing of beauty :Thmbsup:



# no install
# simple to use -
  • select files (all if you want) / click Set time from EXIF - it show the Exif time in the "New Time" column
  • compare
  • select those you want to change
  • click Apply changes

then go off and donate to the author (donationware :up:)
http://www.muralpix.com/donation.html

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,137
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #5 on: May 19, 2017, 05:02:28 AM »
How do I navigate Power Shell?  :tellme:

If this is still need, here is how:

- Open PowerShell window ( Run: powershell )
- You will get a PowerShell window, starting in your profile directory
C:\Users\Kurt\

- now tell the machine you want to change the folder:
use 'Set-Location', short 'SL', or the alias, know from DOS days: 'CD'
cd

- add a space after CD

- net start typing 'pic' and press TAB key to cycling  through all matching folders (if any), and you will get:
cd .\Pictures

- press Enter
C:\Users\Kurt\Pictures



- - -

Extra tip:
- use TAB key everywhere and every time in PoSh to aid you navigating
- press Ctrl+C to cancel current typed command and get a new line
- Type 'cd ..' + ENTER to go to parent directory
- Type 'cd \' + ENTER to go to the root of a drive
- Type 'H:' + ENTER to switch to drive with letter H
- Type 'cd ~' + ENTER to switch to your home directory C:\Users\Kurt\
- Type 'cd ~\' + TAB to cycling  through all folders


Here is a better explanation
http://programminghi.../intro-to-powershell


HTH?  :Thmbsup:
 
« Last Edit: May 19, 2017, 05:11:52 AM by AbteriX »

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 97
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #6 on: May 19, 2017, 06:10:29 AM »
Hello there .o/

When I moved my files to this computer (x64 Windows 10 Home), I accidentally & unfortunately used a program that has erased almost all original info   and changed every jpg "Created Time".
The way I understand it, the "created time" is when space was first reserved on the drive to write the file to it. So it would be normal behaviour, not an issue related to the program you used to perform the copy.

Anyway…
Do 'you' know of a program that can do this? Or can & will 'you' write a script to make it happen?   
I actually remember making such a batch script a few years back, which made use of a freeware command line tool named smarttimestamp (available on Softpedia : http://www.softpedia...mart-Timestamp.shtml but you should probably use the latest version from https://sites.google...ralev/smarttimestamp )
I'll try to find it when I get back home (currently at work) and to remember to post it here :]

Edit : after re-reading the thread from back then (here, in french), you don't even need to make a whole script :
smarttimestamp . *.jp* /cd-modified /ct-modified
shoud do it.
« Last Edit: May 19, 2017, 06:21:25 AM by ConstanceJill »

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,192
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #7 on: May 19, 2017, 08:37:14 AM »
I am very grateful for your help, AbteriX, tomos, ConstanceJill. Thank you! It has been a pleasure to read your responses and TRY to do as you said. In the end, what was the easiest way was to follow ConstanceJill's link to smarttimestamp and simply place smarttimestamp.exe in /Pictures. I then did a "Command Line from here", pasting smarttimestamp . *.jp* /cd-modified /ct-modified. A second later, the job was done!

Thank you!  :up:

Post modified:
-----------
One must first remove write-protection from the picture files, otherwise smarttimestamp will simply stop at the first protected file.
« Last Edit: May 19, 2017, 09:59:12 AM by Curt »

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,623
    • View Profile
    • Donate to Member
Re: help needed for batch change of jpg 'created time'
« Reply #8 on: May 19, 2017, 08:45:37 AM »
^ Very good: Bookmarked

Also interesting to learn a bit about using the command line from Abterix :up:

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,192
    • View Profile
    • Donate to Member
Re: Problem Solved. (batch change of jpg 'created time')
« Reply #9 on: May 19, 2017, 10:08:22 AM »
HTH?  :D

Why does AbteriX keep asking How The Hell without finishing the question?
I am not trying to be funny... hehehe... but the biggest kitchen manufacturer in Denmark is named HTH, so search answers in Danish are not explaining this HTH

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,623
    • View Profile
    • Donate to Member
Re: Problem Solved. (batch change of jpg 'created time')
« Reply #10 on: May 19, 2017, 10:49:01 AM »
I am not trying to be funny... hehehe...
but you're laughing so we cant be sure :P

just in case:
Hope that helps