[Solved]Help with a batch script

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
kaizer

[Solved]Help with a batch script

Post by kaizer »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kaizer

Re: [Solved]Help with a batch script

Post by kaizer »

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

Re: [Solved]Help with a batch script

Post by mockturtl »

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.
kaizer

Re: [Solved]Help with a batch script

Post by kaizer »

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: 650
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re: [Solved]Help with a batch script

Post by ibm450 »

OUCH, GOT THE SAME REPORT, USING CHROME
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
mockturtl

Re: [Solved]Help with a batch script

Post by mockturtl »

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.
User avatar
Oscar799
Level 20
Level 20
Posts: 10405
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: [Solved]Help with a batch script

Post by Oscar799 »

Moved here by moderator
Image
Locked

Return to “Scripts & Bash”