Olympus UK E-System User Group
Olympus UK E-System User Group

Join our unique resource for Olympus Four Thirds E-System DSLR and Pen and OM-D Micro Four Thirds photographers. Show your images via our free e-group photo gallery. Please read the e-group.uk.net forum terms and conditions before posting for the first time. Above all, welcome!


Go Back   Olympus UK E-System User Group > Site news and information > Tutorials, Informative & Classic threads

Tutorials, Informative & Classic threads A new e-Group area for all the wonderful tutorials and helpful threads put on here by our members. Tutorials on using software, camera hardware - and feel free to request a tutorial if you need assistance!

Reply
 
Thread Tools Display Modes
  #1  
Old 3rd January 2015
Phill D's Avatar
Phill D Phill D is offline
Full member
 
Join Date: Apr 2011
Location: Derbyshire
Posts: 10,133
Thanks: 1,210
Thanked 1,455 Times in 1,344 Posts
Likes: 1,145
Liked 2,452 Times in 1,162 Posts
How to search files for lens info?

Does anyone know a good way of searching photo files for what lens was used to take the image? I've been through several folders worth of files so fat pulling up exif info looking at fl to narrow it down but it's pretty tedious and not definitive. Is it possible to just search for the lens used? What I'm trying to do is to find the last time I used my 75-300 lens. Is there an easy way to search files & folders for that lens?
Reply With Quote
  #2  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

It could be done by 'bash' experts, using Unix/Linux command line utilities. Unfortunately I'm not an expert and would have to get up to speed with bash. The scheme would be to:

a) Search through the directories for JPEG files.
b) Pass the file to the exif command line utility.
c) Search in the exif output for the focal length.

It would probably look like this sort of thing (which doesn't work as it stands!)

for i in `find . -name '*.jp*g'`; do exif $i | grep 'Focal Length'; done

Jim
Reply With Quote
  #3  
Old 3rd January 2015
StephenL's Avatar
StephenL StephenL is offline
Senior Pixelmonger
 
Join Date: May 2008
Location: Yorkshire Dales
Posts: 9,863
Thanks: 984
Thanked 1,126 Times in 921 Posts
Likes: 658
Liked 755 Times in 499 Posts
Re: How to search files for lens info?

There are many applications you can use to search exif files for data, such as Irfanview. Or, you could simply use the metadata search filter within Lightroom, if you use that programme.
__________________
Stephen

A camera takes a picture. A photographer makes a picture

Fuji X system, + Leica and Bronica film

My Flickr site
Reply With Quote
  #4  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

Quote:
Originally Posted by StephenL View Post
There are many applications you can use to search exif files for data, such as Irfanview. Or, you could simply use the metadata search filter within Lightroom, if you use that programme.
But will they descend a directory tree searching for files, or do you have to read in a file at a time?

Jim
Reply With Quote
  #5  
Old 3rd January 2015
StephenL's Avatar
StephenL StephenL is offline
Senior Pixelmonger
 
Join Date: May 2008
Location: Yorkshire Dales
Posts: 9,863
Thanks: 984
Thanked 1,126 Times in 921 Posts
Likes: 658
Liked 755 Times in 499 Posts
Re: How to search files for lens info?

I don't have such a product any more, but as I recall they can be used in batch mode.
__________________
Stephen

A camera takes a picture. A photographer makes a picture

Fuji X system, + Leica and Bronica film

My Flickr site
Reply With Quote
  #6  
Old 3rd January 2015
David M's Avatar
David M David M is offline
Full member
 
Join Date: Dec 2007
Location: A Brit now living in Ontario, Canada.
Posts: 6,626
Thanks: 39
Thanked 678 Times in 640 Posts
Likes: 254
Liked 1,350 Times in 803 Posts
Re: How to search files for lens info?

Lightrooms Metadata Browser will show the number of photos taken with each lens unless it's a legacy/third party lens.
__________________
It's the image that's important, not the tools used to make it.

David M's Photoblog
Reply With Quote
  #7  
Old 3rd January 2015
OlyPaul's Avatar
OlyPaul OlyPaul is offline
Senior Member
 
Join Date: Nov 2007
Location: West Midlands
Posts: 5,470
Thanks: 140
Thanked 715 Times in 577 Posts
Likes: 177
Liked 875 Times in 355 Posts
Re: How to search files for lens info?

Quote:
Originally Posted by David M View Post
Lightrooms Metadata Browser will show the number of photos taken with each lens unless it's a legacy/third party lens.
As will most image management programs.
__________________
Regards Paul.
One day I hope to be the person my dogs think I am.

https://www.flickr.com/photos/paul_silk/
Reply With Quote
  #8  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

Quote:
Originally Posted by OlyPaul View Post
As will most image management programs.
I've got 'Faststone' which is pretty powerful, but don't use it much. I've just had a look and can't see what you suggest. It'll batch convert and rename, but you need to select the images first, rather than the program search for them as well. Just curious!

Jim
Reply With Quote
  #9  
Old 3rd January 2015
StephenL's Avatar
StephenL StephenL is offline
Senior Pixelmonger
 
Join Date: May 2008
Location: Yorkshire Dales
Posts: 9,863
Thanks: 984
Thanked 1,126 Times in 921 Posts
Likes: 658
Liked 755 Times in 499 Posts
Re: How to search files for lens info?

PIE is a useful programme, if you're on Widows.
__________________
Stephen

A camera takes a picture. A photographer makes a picture

Fuji X system, + Leica and Bronica film

My Flickr site
Reply With Quote
  #10  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

Cracked it (sort of!):

for i in `find . -name '*.jpg'`; do echo $i; exif --no-fixup $i | grep 'Focal Length '; done > dummy.txt

It's not pretty, but it works.

It creates a file 'dummy.txt' in a few seconds, with entries of this sort on my machine:

./Jack_and_Carmels_40th/P5195171-1024px.jpg
Focal Length |17.0 mm
./Jack_and_Carmels_40th/P5195174-800px.jpg
Focal Length |21.0 mm
./Jack_and_Carmels_40th/P5195192-800px.jpg
Focal Length |21.0 mm
./Jack_and_Carmels_40th/P5195208-800px.jpg
Focal Length |39.0 mm
./Jack_and_Carmels_40th/P5195215-800px.jpg
Focal Length |20.0 mm
./Jack_and_Carmels_40th/P5195212-800px.jpg
Focal Length |35.0 mm
./Jack_and_Carmels_40th/P5195177-800px.jpg
Focal Length |17.0 mm
./Jack_and_Carmels_40th/P5195216-800px.jpg
Focal Length |29.0 mm
./Jack_and_Carmels_40th/P5195201-800px.jpg
Focal Length |39.0 mm
./Jack_and_Carmels_40th/P5195179-800px.jpg
Focal Length |19.0 mm
./Jack_and_Carmels_40th/P5195198-800px.jpg
Focal Length |33.0 mm
./Jack_and_Carmels_40th/P5195169-1024px.jpg
Focal Length |14.0 mm
etc.

As there were lots of JPEG files in the directory without EXIF data, there was lots of junk which I've stripped out.

With a bit more fiddling about I expect 'sort' could be used to sort the output according to focal length.

With 'Windoze' I expect you could use Cygwin to do it.

Jim
Reply With Quote
  #11  
Old 3rd January 2015
StephenL's Avatar
StephenL StephenL is offline
Senior Pixelmonger
 
Join Date: May 2008
Location: Yorkshire Dales
Posts: 9,863
Thanks: 984
Thanked 1,126 Times in 921 Posts
Likes: 658
Liked 755 Times in 499 Posts
Re: How to search files for lens info?

Very good, but not everyone wants to mess about with code when there are dozens of applications, many free, which can do this for you. But as a coder's exercise, very interesting as it shows that the exif contains a great deal of information which can be extracted if required.
__________________
Stephen

A camera takes a picture. A photographer makes a picture

Fuji X system, + Leica and Bronica film

My Flickr site
Reply With Quote
  #12  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

Quote:
Originally Posted by StephenL View Post
Very good, but not everyone wants to mess about with code when there are dozens of applications, many free, which can do this for you.
But in my experience you need to fire up the application and then select the files or groups of files you want to examine. The application will then display the data. A command line will run before even a GUI has started up. It also finds the files, if necessary descending a directory tree, rather than the user having to select them.

Jim
Reply With Quote
  #13  
Old 3rd January 2015
Phill D's Avatar
Phill D Phill D is offline
Full member
 
Join Date: Apr 2011
Location: Derbyshire
Posts: 10,133
Thanks: 1,210
Thanked 1,455 Times in 1,344 Posts
Likes: 1,145
Liked 2,452 Times in 1,162 Posts
Re: How to search files for lens info?

This is great support guys thanks. It's going to take me a while to get up to speed and understand what you are telling me though. If I have to go for coding then I'll need to enlist my son's help as that's way out of my league. A programme that can do it for me would be ideal. I'm surprised no one asked why I wanted to do this? Well basically it's because I seem to have lost my 75-300mm lens and I was trying to work out the last time I had used it to see if it gave me a clue as to where I'd lost it or more hopefully where I'd put it. Having turned the house inside out three times now I'm beginning to suspect it got left behind on our recent trip to London I'll probably have to start tying my gloves together with elastic soon Anyway back to re-read the info you've all given me and fingers crossed hoping it turns up soon.
Reply With Quote
  #14  
Old 3rd January 2015
Jim Ford Jim Ford is offline
Full member
 
Join Date: Dec 2007
Location: Watford, Herts..
Posts: 8,899
Thanks: 502
Thanked 634 Times in 550 Posts
Likes: 2,869
Liked 1,761 Times in 1,135 Posts
Re: How to search files for lens info?

The EXIF doesn't give the maximum focal length, only that at which it was used. This means that the EXIF might show 100mm, which could mean that the image was taken with a 75-300mm lens or a (say) 50-150mm one.

I hope you find the lens OK.

Jim
Reply With Quote
  #15  
Old 3rd January 2015
OM USer's Avatar
OM USer OM USer is offline
Full member
 
Join Date: Jun 2012
Location: London
Posts: 12,650
Thanks: 2,479
Thanked 1,560 Times in 1,484 Posts
Likes: 6,533
Liked 1,468 Times in 941 Posts
Re: How to search files for lens info?

I use the windows GUI "exiftool" to look at the exif data in my jpgs/orfs. If you select a directory and then select all the files in that directory you can "export" the exif data for all the selected files to a text file (file has the same name as the image file but with .txt extension). You can then search the text file(s) using standard windows tools.

The advantage of this is that all the exif data is exported so its easy to search for a lens (eg: "75-300").

I know this isn't quite what was required as the brief called for a hierarchical directory search. However the GUI exiftool has a command line version and one of the options is:
-r (-recurse) Recursively process subdirectories
which seems to be just the thing you are looking for. I haven't used the command line version but offer it up as something to look into that may meet your needs.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apple Aperture / E-M1 RAW files: some files pink/purple after import Angus Olympus OM-D E-M1 0 20th December 2013 06:01 PM
In search of the sun - Part 2 Ann1e Foto Fair 6 10th July 2012 09:57 PM
In Search of Autumnin Llanberis Alan Clogwyn Foto Fair 14 26th October 2010 06:20 PM
Stop and search Ellie The lounge 49 5th November 2008 08:58 PM
Useful lens info Scapula Memory Standard zoom and mid range 4 13th February 2008 03:03 PM


All times are GMT. The time now is 11:04 AM.


The Write Technology Ltd, 2007-2019, All rights reservedAd Management plugin by RedTyger