Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Main Photography Discussion
What photo's does your camera think are rejects :) On a Mac or Linux - Exiftool
Page 1 of 2 next>
Mar 26, 2017 13:44:16   #
blackest Loc: Ireland
 
Well potential rejects at least.

For the last couple of days i have been playing around with exiftool initially it looks hard to use but it isn't really.

Its a commandline tool if you are running a mac and this is new to you then you will need to open a terminal and paste in:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This installs and sets up a package repository it will ask you to agree to a few things like installing xcode commandline tools but don't worry you will not be using them, your mac will be :) next:

brew install exiftool

when that's done you can start to play.

exiftool can read and write the exif data on your image files and there is a lot of it and to be fair there is no need to understand most of it.

a handy thing with a mac is you can drag a file or folder from a finder window to a terminal window.

typing
exiftool

then a space then dragging an image file to the terminal results in a line like:

exiftool /users/me/myphoto.dng

pressing return will result in exiftool listing everything thats in the exif of that photo in a human readable format( if you can call it that).

exiftool -s /users/me/myphoto.dng

This is more useful as the tagnames are given how exiftool wants to see them.

exiftool -AFPointsInFocus /Volumes/K-5/DCIM/104_2603/myphoto.dng

(/Volumes/K-5/ is my SD-Card and my photo's are in DCIM/104_2603/ the 2603 is generated by my camera because today is the 26th of March and thats when i took this photo.)

will tell you which focus point was in focus when you took the photo, if no focus points were in focus then it will say 'none'.
Of course doing this for 100 photo's is long and tedious:

exiftool -AFPointsInFocus /Volumes/K-5/DCIM/104_2603/

Passing it the folder name instead of the file name results in exiftool looking in that folder at every image file, reading the focuspoint value and writing it out to the terminal

exiftool -AFPointsInFocus /Volumes/K-5/DCIM/104_2603/_IGP3539.DNG
AF Points In Focus : None

By feeding it the directory it makes a huge list in the terminal, that's not fun, so one last thing redirection:

exiftool -AFPointsInFocus /Volumes/K-5/DCIM/104_2603/ > focus.txt

This tells it to send its output to a file called focus.txt you can call it anything you like but i like simple.

ls, is the dir command for unix macs and linux.

typing: ls
will make a list of all that's in your home folder (ok whichever folder the terminal is opened in currently).

you should now see there is a new file called focus.txt

if you open your home folder in finder you can click on that file and probably textedit will open it.

now with the file open in textedit tap cmd F and it will ask you what you want to find type:
none
in my case 'none' was found 4 times.


======= /Volumes/K-5/DCIM/100_2302/_IGP3212.DNG
AF Points In Focus : None
======== /Volumes/K-5/DCIM/100_2302/_IGP3229.DNG
AF Points In Focus : None
======== /Volumes/K-5/DCIM/100_2302/_IGP3234.DNG
AF Points In Focus : None
======== /Volumes/K-5/DCIM/100_2302/_IGP3268.DNG
AF Points In Focus : None

These 4 Photo's have no in focus , focus points.
_IGP3212.DNG
_IGP3229.DNG
_IGP3234.DNG
_IGP3268.DNG

My camera thinks they are terrible :)

To be fair looking at them it's hard to tell, I was using a manual lens shooting at the same subject without adjusting focus between shots so there can only be a few inches difference to the subject distance and its a short focal length lens.

But now you see how you can use:

exiftool -AFPointsInFocus /NameOfFolder/ > infocus.txt

to produce a list of photo's and then find which are out of focus.

a slightly different method would be type cd then a space drag the folder into the terminal and press return
if you type:
ls
you will get a list of files in that folder:

exiftool -AFPointsInFocus .

the period at the end means 'this current folder'

exiftool -AFPointsInFocus . > focus.txt

will write the results in that folder too.



------ extra's---------
This has all been reading from the raw files you can write as well.

e.g and this is a bad example since you would never want to do this

exiftool -AFPointsInFocus="none" _myphoto.dng
instead of reading the AFPointsInFocus tag it writes none to it.

It will generally refuse to write the wrong type of data but if its words rather than numbers in the exif you can usually write anything and maybe get some weird errors.

the exiftool -s command lists the tags in the format needed to read or write. not every raw file has the same tags sometimes there is the same thing but called differently depending if its canon nikon pentax ...

Sorry for the length as it all boils down to:

exiftool -AFPointsInFocus . > focus.txt

Reply
Mar 26, 2017 15:16:40   #
Bobspez Loc: Southern NJ, USA
 
Does the file name go where the dot is in your example (eg. exiftool -AFPointsInFocus DSC_1102.JPG >focus.txt)?

I tried it with both a JPG and NEF file and got no results in my focus.txt file.

blackest wrote:
.....

Sorry for the length as it all boils down to:

exiftool -AFPointsInFocus . > focus.txt

Reply
Mar 26, 2017 16:58:54   #
blackest Loc: Ireland
 
Bobspez wrote:
Does the file name go where the dot is in your example (eg. exiftool -AFPointsInFocus DSC_1102.JPG >focus.txt)?

I tried it with both a JPG and NEF file and got no results in my focus.txt file.


The dot is the command line way of saying current directory.

It should process all files in there.

Tags are quite specific things if they are not in your exif then there is nothing to show.

exiftool -AFPointsInFocus DSC_1102.JPG >focus.txt not quite right
exiftool -AFPointsInFocus DSC_1102.JPG > focus.txt
you need the space before the word focus or its not seen as a separate argument
if you try
exiftool -AFPointsInFocus DSC_1102.JPG
do you get a result?

If not try

exiftool -s DSC_1102.JPG that should bring all the tags out it's possible that your camera has another tag for the same thing it definitely works for Pentax , which is kind of cool since there was a canon plugin for lightroom which would show the active focus points and zip for pentax.

Reply
 
 
Mar 26, 2017 20:56:14   #
Bobspez Loc: Southern NJ, USA
 
I tried it with jpg files taken with several cameras and autofocus lenses and got nothing. What does the output look like when it does work?

.
blackest wrote:
The dot is the command line way of saying current directory.

It should process all files in there.

Tags are quite specific things if they are not in your exif then there is nothing to show.

exiftool -AFPointsInFocus DSC_1102.JPG >focus.txt not quite right
exiftool -AFPointsInFocus DSC_1102.JPG > focus.txt
you need the space before the word focus or its not seen as a separate argument
if you try
exiftool -AFPointsInFocus DSC_1102.JPG
do you get a result?

If not try

exiftool -s DSC_1102.JPG that should bring all the tags out it's possible that your camera has another tag for the same thing it definitely works for Pentax , which is kind of cool since there was a canon plugin for lightroom which would show the active focus points and zip for pentax.
The dot is the command line way of saying current ... (show quote)

Reply
Mar 26, 2017 21:15:05   #
blackest Loc: Ireland
 
Bobspez wrote:
I tried it with jpg files taken with several cameras and autofocus lenses and got nothing. What does the output look like when it does work?

.


exiftool -AFPointsInFocus .
======== ./_IGP3405.dng
AF Points In Focus : Center (vertical)
======== ./_IGP3406.dng
AF Points In Focus : Center (vertical)
======== ./_IGP3407.dng
AF Points In Focus : Center (horizontal)
======== ./_IGP3408.dng
AF Points In Focus : Center (horizontal)
1 directories scanned
4 image files read

not every file has the tag, and exif tool can pull a lot of information from a lot of files so i have just found out :) epubs and wav files for 2

if you try exiftool photo.jpg it should give any tags it can find in the exif.

If you post a jpeg to this thread and tick save original i will see what it tells me.

Reply
Mar 26, 2017 21:40:13   #
Bobspez Loc: Southern NJ, USA
 
I have used exiftool in the past for things like shutter count. I'll posted 2 jpgs below, one taken with a d7000 and one taken with a Nikon 1 J1, but don't think there's any focus data. Maybe only certain newer cameras store that data. Maybe Photoshop messes with that data?

blackest wrote:
exiftool -AFPointsInFocus .
======== ./_IGP3405.dng
AF Points In Focus : Center (vertical)
======== ./_IGP3406.dng
AF Points In Focus : Center (vertical)
======== ./_IGP3407.dng
AF Points In Focus : Center (horizontal)
======== ./_IGP3408.dng
AF Points In Focus : Center (horizontal)
1 directories scanned
4 image files read

not every file has the tag, and exif tool can pull a lot of information from a lot of files so i have just found out :) epubs and wav files for 2

if you try exiftool photo.jpg it should give any tags it can find in the exif.

If you post a jpeg to this thread and tick save original i will see what it tells me.
exiftool -AFPointsInFocus . br ======== ./_IGP3405... (show quote)


(Download)


(Download)

Reply
Mar 26, 2017 22:35:36   #
blackest Loc: Ireland
 
Bobspez wrote:
I have used exiftool in the past for things like shutter count. I'll posted 2 jpgs below, one taken with a d7000 and one taken with a Nikon 1 J1, but don't think there's any focus data. Maybe only certain newer cameras store that data. Maybe Photoshop messes with that data?

This is the flower i saved as test1.jpg the 2nd as test2.jpg this used the centre focus point.
----------------------------------------------------------------------
exiftool -s test1.jpg
ExifToolVersion : 10.40
FileName : test1.jpg
Directory : .
FileSize : 4.5 MB
FileModifyDate : 2017:03:27 03:05:40+01:00
FileAccessDate : 2017:03:27 03:08:00+01:00
FileInodeChangeDate : 2017:03:27 03:05:50+01:00
FilePermissions : rw-r--r--
FileType : JPEG
FileTypeExtension : jpg
MIMEType : image/jpeg
ExifByteOrder : Little-endian (Intel, II)
Make : NIKON CORPORATION
Model : NIKON 1 J1
Orientation : Horizontal (normal)
XResolution : 300
YResolution : 300
ResolutionUnit : inches
Software : Ver.1.40
ModifyDate : 2015:06:18 15:34:35
YCbCrPositioning : Co-sited
ExposureTime : 1/100
FNumber : 9.0
ExposureProgram : Shutter speed priority AE
ISO : 100
SensitivityType : Recommended Exposure Index
ExifVersion : 0230
DateTimeOriginal : 2015:06:18 15:34:35
CreateDate : 2015:06:18 15:34:35
ComponentsConfiguration : Y, Cb, Cr, -
CompressedBitsPerPixel : 4
ExposureCompensation : 0
MaxApertureValue : 5.7
MeteringMode : Spot
LightSource : Unknown
Flash : No Flash
FocalLength : 280.0 mm
MakerNoteVersion : 2.10
Quality : Fine
WhiteBalance : Auto
FocusMode : AF-S
FlashSetting :
FlashType :
WhiteBalanceFineTune : 0 0
WB_RBLevels : 1.75 1.83984375 1 1
ProgramShift : 0
ExposureDifference : 0
FlashExposureComp : 0
ImageBoundary : 0 0 3872 2592
CropHiSpeed : Off (3904x2606 cropped to 3904x2606 at pixel 0,0)
SerialNumber : 32134098
VRInfoVersion : 0101
VibrationReduction : On
VRMode : Unknown (1)
ActiveD-Lighting : Off
PictureControlVersion : 0100
PictureControlName : Standard
PictureControlBase : Standard
PictureControlAdjust : Default Settings
PictureControlQuickAdjust : Normal
Brightness : Normal
HueAdjustment : None
FilterEffect : n/a
ToningEffect : n/a
ToningSaturation : n/a
TimeZone : -05:00
DaylightSavings : Yes
DateDisplayFormat : M/D/Y
ISOExpansion : Off
ISO2 : 100
ISOExpansion2 : Off
LensType : G VR [5]
Lens : 55-300mm f/4.5-5.6
FlashMode : Did Not Fire
ShootingMode : Continuous, Auto ISO
LensFStops : 9.33
ShotInfoVersion : 0400
NoiseReduction : Off
ColorBalanceVersion : 0400
LensDataVersion : 0401
RetouchHistory : None
ImageDataSize : 3752241
ShutterCount : 3758
FlashInfoVersion : 0200
VariProgram :
HighISONoiseReduction : Off
AFInfo2Version : 0200
ContrastDetectAF : Off
AFAreaMode : Single
PhaseDetectAF : On (73-point)
PrimaryAFPoint : E8 (Center)
AFPointsUsed : E8

AFFineTune : Off
AFFineTuneIndex : n/a
AFFineTuneAdj : 0
SubSecTime : 00
SubSecTimeOriginal : 00
SubSecTimeDigitized : 00
FlashpixVersion : 0100
ColorSpace : sRGB
ExifImageWidth : 3872
ExifImageHeight : 2592
InteropIndex : R98 - DCF basic file (sRGB)
InteropVersion : 0100
SensingMethod : One-chip color area
FileSource : Digital Camera
SceneType : Directly photographed
CFAPattern : [Red,Green][Green,Blue]
CustomRendered : Normal
ExposureMode : Auto
DigitalZoomRatio : 1
FocalLengthIn35mmFormat : 756 mm
SceneCaptureType : Standard
GainControl : None
Contrast : Normal
Saturation : Normal
Sharpness : Normal
SubjectDistanceRange : Unknown
LensModel : VR 55-300mm f/4.5-5.6G
Compression : JPEG (old-style)
ThumbnailOffset : 20204
ThumbnailLength : 8426
Rating : 0
MPFVersion : 0100
NumberOfImages : 2
MPImageFlags : Dependent child image
MPImageFormat : JPEG
MPImageType : Large Thumbnail (full HD equivalent)
MPImageLength : 871511
MPImageStart : 3818368
DependentImage1EntryNumber : 0
DependentImage2EntryNumber : 0
ImageWidth : 3872
ImageHeight : 2592
EncodingProcess : Baseline DCT, Huffman coding
BitsPerSample : 8
ColorComponents : 3
YCbCrSubSampling : YCbCr4:2:2 (2 1)
Aperture : 9.0
AutoFocus : On
BlueBalance : 1.839844
ImageSize : 3872x2592
LensSpec : 55-300mm f/4.5-5.6 G VR [5]
PreviewImage : (Binary data 871511 bytes, use -b option to extract)
Megapixels : 10.0
RedBalance : 1.75
ScaleFactor35efl : 2.7
ShutterSpeed : 1/100
SubSecCreateDate : 2015:06:18 15:34:35.00
SubSecDateTimeOriginal : 2015:06:18 15:34:35.00
SubSecModifyDate : 2015:06:18 15:34:35.00
ThumbnailImage : (Binary data 8426 bytes, use -b option to extract)
CircleOfConfusion : 0.011 mm
FOV : 2.7 deg
FocalLength35efl : 280.0 mm (35 mm equivalent: 756.0 mm)
HyperfocalDistance : 782.79 m
LightValue : 13.0
---------------------------------------------------------------------------
The 2nd image had this to say no focus information other than it was manual on a d7000
I did do the same thing with the 2nd photo but couldnt post it as it was too long

so the first jpeg use

exiftool -AFPointsUsed -PrimaryAFPoint nameofimage.jpg

AF Points Used : E8
Primary AF Point : E8 (Center)

the second jpeg had nothing to find.

Its probably better to use on a file that is fresh from the camera rather than saved out of another program.
hope this helps

Reply
 
 
Mar 27, 2017 08:18:35   #
JCam Loc: MD Eastern Shore
 
I don't think the camera is qualified to evaluate whether YOU should keep a photo or not; it's a semi-dumb instrument that can only evaluate the shot based upon pre-established parameters which have few if any artistic references. It's your photo and only has to please you and can probably be improved in Post Processing if needed.

Reply
Mar 27, 2017 12:23:08   #
blackest Loc: Ireland
 
JCam wrote:
I don't think the camera is qualified to evaluate whether YOU should keep a photo or not; it's a semi-dumb instrument that can only evaluate the shot based upon pre-established parameters which have few if any artistic references. It's your photo and only has to please you and can probably be improved in Post Processing if needed.


True enough but it's probably fair to say you intended the subject to be in focus which usually means you got the camera to focus where the subject was. Or that was the intention anyway. However if the subject isn't in focus its fairly pointless trying to spend time working on it when you have other shots which were in focus and sharp.

In the end it is your call, but an image that is blurry where you intended it should be sharp?

Reply
Mar 27, 2017 13:53:01   #
JCam Loc: MD Eastern Shore
 
blackest wrote:
True enough but it's probably fair to say you intended the subject to be in focus which usually means you got the camera to focus where the subject was. Or that was the intention anyway. However if the subject isn't in focus its fairly pointless trying to spend time working on it when you have other shots which were in focus and sharp.

In the end it is your call, but an image that is blurry where you intended it should be sharp?


I agree, but unless the circumstances are unusual, there isn't much benefit to knowing it is out of focus immediately after being taken, unless you have the time to check each photo between shots. Auto Focus will sometimes focus on the wrong thing, like something in the background when you had focused on the bird's eye (it happens to me regularly ), but how often will the bird still be there for another shot after you check all, or even some of, the data?

Reply
Mar 27, 2017 14:07:28   #
blackest Loc: Ireland
 
JCam wrote:
I agree, but unless the circumstances are unusual, there isn't much benefit to knowing it is out of focus immediately after being taken, unless you have the time to check each photo between shots. Auto Focus will sometimes focus on the wrong thing, like something in the background when you had focused on the bird's eye (it happens to me regularly ), but how often will the bird still be there for another shot after you check all, or even some of, the data?
I agree, but unless the circumstances are unusual,... (show quote)


This is something for when you are back home and ready to post process your photo's. Pretty much everyone culls their photo's because of one reason or another. If a photo hasn't got focus it's one reason to reject a photo.

Reply
 
 
Mar 27, 2017 14:26:25   #
Bobspez Loc: Southern NJ, USA
 
Thank you blackest. Interesting information. I used ... exiftool -AFPointsUsed -PrimaryAFPoint *.jpg on a whole folder of pics from my memory cards for the D7000 and the Nikon 1 J1. Interestingly enough, only the jpgs from the J1 showed info. All the pics from the D7000 showed "none". But I did get this focus info from one of the D7000 pics. Somehow the focus is set for contrast detect rather than phase detect, so maybe that means no AF points are used. I'll have to figure out how to change it back to phase detect and try it again. Maybe contrast detect is automatically selected when focus tracking is on.

AF Aperture : 5.8
Focus Position : 0x11
Focus Distance : 1.78 m

Contrast Detect AF : On
AF Area Mode : Contrast-detect (normal area)
Phase Detect AF : Off
Primary AF Point : (none)
AF Points Used : (none)

Focus Mode : AF-S
Lens ID : AF-S DX VR Nikkor 55-300mm f/4.5-5.6G ED
Auto Focus : On

AF-C Priority Selection : Focus
AF-S Priority Selection : Focus
Number Of Focus Points : 39 Points
Focus Tracking Lock On : 5 Long
Focus Point Wrap : No Wrap
AF Point Illumination : Auto
AF Assist : On

Now that we are on this topic I seem to recall a Nikon software that actually superimposed the image of the focus point squaress on the jpg file image. It has been a couple of years since I read about it so can not recall it's name.

blackest wrote:
This is the flower i saved as test1.jpg the 2nd as test2.jpg this used the centre focus point.
----------------------------------------------------------------------
.........

so the first jpeg use

exiftool -AFPointsUsed -PrimaryAFPoint nameofimage.jpg

.....

Its probably better to use on a file that is fresh from the camera rather than saved out of another program.
hope this helps

Reply
Mar 27, 2017 14:30:07   #
Dngallagher Loc: Wilmington De.
 
blackest wrote:
Well potential rejects at least.

For the last couple of days i have been playing around with exiftool initially it looks hard to use but it isn't really.

Its a commandline tool if you are running a mac and this is new to you then you will need to open a terminal and paste in:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This installs and sets up a package repository it will ask you to agree to a few things like installing xcode commandline tools but don't worry you will not be using them, your mac will be :) next:

brew install exiftool

when that's done you can start to play.

exiftool can read and write the exif data on your image files and there is a lot of it and to be fair there is no need to understand most of it.

a handy thing with a mac is you can drag a file or folder from a finder window to a terminal window.

typing
exiftool

then a space then dragging an image file to the terminal results in a line like:

exiftool /users/me/myphoto.dng

pressing return will result in exiftool listing everything thats in the exif of that photo in a human readable format( if you can call it that).
Well potential rejects at least. br br For the la... (show quote)


Interesting information indeed, useful as well, however, there is an easier way - with EXIFTOOL installed on a Mac or Windows computer, add in the free PYEXIFTOOLGUI and viola, no more command line need.

You can pass command line arguments to EXIFTOOL from within the GUI, or make use of command line via the terminal command as you describe, but many people, especially Mac users shy away from the terminal commands ;)

Get it here for both Windows and Mac

https://hvdwolf.github.io/pyExifToolGUI/

On a Mac running El Capitan or Sierra, you will need to do a little extra work to enable it to run due to a folder location change for the executable - easily managed by following these instructions.

http://tonyredhead.com/google-tips/pyexiftool-exiftool-linking-issue


(Download)

Reply
Mar 27, 2017 14:34:32   #
Bobspez Loc: Southern NJ, USA
 
But there's still a bit of a thrill in opening a DOS window and typing in line commands. A blast from the past.

Dngallagher wrote:
Interesting information indeed, useful as well, however, there is an easier way - with EXIFTOOL installed on a Mac or Windows computer, add in the free PYEXIFTOOLGUI and viola, no more command line need.

You can pass command line arguments to EXIFTOOL from within the GUI, or make use of command line via the terminal command as you describe, but many people, especially Mac users shy away from the terminal commands ;)

Get it here for both Windows and Mac

https://hvdwolf.github.io/pyExifToolGUI/

On a Mac running El Capitan or Sierra, you will need to do a little extra work to enable it to run due to a folder location change for the executable - easily managed by following these instructions.

http://tonyredhead.com/google-tips/pyexiftool-exiftool-linking-issue
Interesting information indeed, useful as well, ho... (show quote)

Reply
Mar 27, 2017 15:00:21   #
Dngallagher Loc: Wilmington De.
 
Bobspez wrote:
Thank you blackest. Interesting information. I used ... exiftool -AFPointsUsed -PrimaryAFPoint *.jpg on a whole folder of pics from my memory cards for the D7000 and the Nikon 1 J1. Interestingly enough, only the jpgs from the J1 showed info. All the pics from the D7000 showed "none". But I did get this focus info from one of the D7000 pics. Somehow the focus is set for contrast detect rather than phase detect, so maybe that means no AF points are used. I'll have to figure out how to change it back to phase detect and try it again. Maybe contrast detect is automatically selected when focus tracking is on.


Now that we are on this topic I seem to recall a Nikon software that actually superimposed the image of the focus point squaress on the jpg file image. It has been a couple of years since I read about it so can not recall it's name.
Thank you blackest. Interesting information. I u... (show quote)


You can see focus points in Nikons View NX2 and VIEW NX-I - both free.

Also -

SHOWFOCUSPOINTS is a free plugin for Lightroom that does what you are talking about. Very handy to determine if you are locked in on what you thought you were.

http://www.lightroomfocuspointsplugin.com/

Reply
Page 1 of 2 next>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Main Photography Discussion
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.