[Solved]Help with a batch script

Forum rules
Before you post please read how to get help
kaizer
Level 2
Level 2
Posts: 80
Joined: Wed Feb 16, 2011 8:49 am

[Solved]Help with a batch script

Postby kaizer » Tue Feb 07, 2012 7:39 am

Hello everybody,

Here is the situation. The SD card of my camera was corrupted and I succesfully recovered the pictured by using an amazing opensource freeware called Photorec(http://www.cgsecurity.org/wiki/PhotoRec).
Pb is that I recovered much much more pics than I though and that recovered files have been renamed kind of randomly.
I found a tool Exiv2(http://www.exiv2.org/) able to read the metadate of my files: output similar to :

Code: Select all

~# exiv2 -p s 1.jpg
Filename        : 1.jpg
Filesize        : 1285238 Bytes
Camera make     : FUJIFILM
Camera model    : FinePix F601Z
Image timestamp : 2005:08:07 14:31:22
Image number    :
Exposure time   : 1/70 s
Aperture        : F3.5
Exposure bias   : 0
Flash           : No, auto
Flash bias      :
Focal length    : 6.1 mm
Subject distance:
ISO speed       : 200
Exposure mode   : Auto
Metering mode   : Matrix
Macro mode      : Off
Image quality   : NORMAL
Exif Resolution : 2736 x 1824
White balance   : Auto
Thumbnail       : JPEG, 9612 Bytes
Copyright       :
Exif comment    :


I would like now to write a scipt to do the following:

for each jpg file in the folder:
1) run exiv2 to get the ImageTimeStamp
2) rename the file with the ImageTimeStamp

That would help me to then select the pics I want to keep.

If anyone can indicate me how I can do this I would be grateful.

Thank you in advance

kaizer
Level 2
Level 2
Posts: 80
Joined: Wed Feb 16, 2011 8:49 am

Re: [Solved]Help with a batch script

Postby kaizer » Tue Feb 07, 2012 9:36 am

exiv- -mv ... does the job.
Did not read carrefuly the man page the first time.

User avatar
mockturtl
Level 4
Level 4
Posts: 452
Joined: Sat Oct 09, 2010 8:51 pm

Re: [Solved]Help with a batch script

Postby mockturtl » Tue Apr 10, 2012 9:04 pm

Kaizer, Chrome throws a security warning when I visit this page. I can't tell if it's a feature or a bug (v20/unstable -- released today).

I guess it's the site hosting your avatar:

Code: Select all

Warning: Something's Not Right Here!
membres.lycos.fr contains malware. Your computer might catch a virus if you visit this site.
Google has found malicious software may be installed onto your computer if you proceed. If you've visited this site in the past or you trust this site, it's possible that it has just recently been compromised by a hacker. You should not proceed, and perhaps try again tomorrow or go somewhere else.
We have already notified membres.lycos.fr that we found malware on the site. For more about the problems found on membres.lycos.fr, visit the Google Safe Browsing diagnostic page.
 
If you understand that visiting this site may harm your computer, proceed anyway.
Image

kaizer
Level 2
Level 2
Posts: 80
Joined: Wed Feb 16, 2011 8:49 am

Re: [Solved]Help with a batch script

Postby kaizer » Wed Apr 11, 2012 2:11 am

I don't think the pb comes from me. My other posts do not throw that security warning when I visit them.

User avatar
ibm450
Level 5
Level 5
Posts: 603
Joined: Sun Jan 11, 2009 6:56 am
Location: Kwinana, Western Australia
Contact:

Re: [Solved]Help with a batch script

Postby ibm450 » Wed Apr 11, 2012 9:45 am

OUCH, GOT THE SAME REPORT, USING CHROME
Image
Asus UL50VT laptop ~ LM10 - Unity 12.04 - Win 7
Image

User avatar
mockturtl
Level 4
Level 4
Posts: 452
Joined: Sat Oct 09, 2010 8:51 pm

Re: [Solved]Help with a batch script

Postby mockturtl » Wed Apr 11, 2012 2:28 pm

kaizer wrote:I don't think the pb comes from me. My other posts do not throw that security warning when I visit them.
View-source shows your avatar is where the domain appears. I believe it's a false positive on Google's part. (Imagine: "geocities.com cannot be trusted!")

I just wanted to point out that linuxmint.com is not "infected," despite the scary warning Chrome displays. If the warning bothers anyone, I suggest using Adblock to prevent the gif from loading.
Image

User avatar
Oscar799
Level 19
Level 19
Posts: 9469
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: [Solved]Help with a batch script

Postby Oscar799 » Fri Apr 13, 2012 5:05 am

Moved here by moderator
Image
"Don't fix it if it ain't broken,don't break it if you can't fix it" Husse
Registered Linux User #511789


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 3 guests