Re: find lost jpegs



On Sat, 20 Jun 2009 08:25:43 -0600, davidoznot wrote:

Let's say I have a favorite jpeg image scaled down to 640 pixels wide.
This favorite image has a name "myimage.jpg"

But I cannot find the raw original, as it came off the camera, probably
more like 4000 pixels wide. I suspect I still have this image
somewhere, probably with a name like dscn_1492.jpg

<SNIP>

Is it possible to write a program (perhaps in bash and perl) that could
read something of the jpeg header of the scaled-down copy, and use that
as a search key for examining all the others?

<SNIP>

....anybody know how to do this?

exiftags is one way of getting the exif tag information in a text format.
If your image editing software used to create the scaled image did not
change the "Unique Image ID" tag then you could do something like this.

exiftags scaled.JPG | grep Unique

On my computer returns:

exiftags: field count mismatch (ImageUniqueID)
Unique Image ID: d401B0064000111E1D7D811000000000

Ignoring the error message, (field count mismatch) I searched my Picture
directory for the string "d401B0064000111E1D7D811000000000" and found the
original file.
grep -rl d401B0064000111E1D7D811000000000 Pictures

On my computer returns:
Pictures/alison_camera/2008-02-24--09.58.19/HPIM0001.JPG

With a tiny bit of playing, I can extract the "Unique Image ID" tag from
the scaled file:
exiftags scaled.JPG 2> /dev/null| grep Unique | cut -d' ' -f4

Returns:
d401B0064000111E1D7D811000000000

Putting the above command into the command that searches the Pictures
directory makes a one liner. ( two liner because or line length. )
grep -rl $(exiftags scaled.JPG 2> /dev/null | grep Unique |
cut -d' ' -f4) Pictures

Returns:
Pictures/alison_camera/2008-02-24--09.58.19/HPIM0001.JPG

It should be easy to put in a script.

cat /home/js/bin/findorigpic
#!/bin/sh
# Search directory for images with "Unique Image ID" maching image
# Usage fiorigpic image directory

grep -rl $(exiftags $1 2> /dev/null| grep Unique | cut -d' ' -f4) $2

# END OF findorigpic

A test run appears to work:
findorigpic scaled.JPG Pictures

Returns:
Pictures/alison_camera/2008-02-24--09.58.19/HPIM0001.JPG

If your image editing software used to scale the image changed the
"Unique Image ID" tag, then you do the above but using a tag that wasn't
changed.



.



Relevant Pages

  • Re: help with Photo gallery please - Follow-up Question
    ... You could however try the Group By tag or Sort By tag features in Gallery ... Then save that search in your Searches folder, give it a good name like ... "Trebor chill'n" where Trebor is all the pictures of Trebor and chill'n is ... This would include any photos that you have ...
    (microsoft.public.windows.vista.general)
  • Re: n00b question
    ... tags for php forums on my screen so I dont have to copy and paste ... 100 of them and change the pictures number every time. ... 127 pictures from a race that I would like to post, the tag is ... converting but the how would you go about having it add +1 after it has ...
    (comp.lang.ruby)
  • Re: Warehouse Raid Pictures
    ... i'm hoping someday to tag along to one of these even if ... man that would be a blast! ... I won't save a game for you that you see in the pictures ... 15-20 gun games ...
    (rec.games.pinball)
  • Re: image rollover inside a table cell, please..
    ... Why having tag font to finally show only one image? ... now i'd like to create a link on the 4 pictures and have ... Or only a rollover on each picture? ... Where are and which are the images of replacement? ...
    (comp.lang.javascript)