Unable to list pictures taken with flash

Started by jojomimi, October 06, 2021, 01:19:31 PM

Previous topic - Next topic

jojomimi

exiftool -canon "_MG_2054.CR2"

File Name                       : _MG_2054.CR2
Camera Model Name               : Canon EOS 1300D
Date/Time Original              : 2021:09:03 17:07:04
Shooting Mode                   : Aperture-priority AE
Shutter Speed                   : 1/500
Aperture                        : 5.6
Metering Mode                   : Evaluative
Exposure Compensation           : 0
ISO                             : 100
Lens                            : 55.0 - 200.0 mm
Focal Length                    : 55.0 mm
Image Size                      : 5184x3456
Quality                         : RAW
Flash                           : Off, Did not fire
White Balance                   : Auto
Focus Mode                      : One-shot AF
Contrast                        : Normal
Sharpness                       : 3
Saturation                      : Normal
Color Tone                      : Normal
Color Space                     : Uncalibrated
Long Exposure Noise Reduction   : Off
File Size                       : 23 MB
Drive Mode                      : Single-frame Shooting



exiftool -if "$Canon:Flash eq 'Off, Did not fire'" .
    1 directories scanned
  349 files failed condition
    0 image files read


I know I have at least one picture (_MG_2054.CR2) taken with no flash in my current folder, but filtering them out gives me only failing condition.
Someone a hint ? (I'm on Linux Mint)

StarGeek

Quote from: jojomimi on October 06, 2021, 01:19:31 PM
exiftool -canon "_MG_2054.CR2"

See FAQ #3.

The Canon tag is a Shortcut tag for some specific tags.  See the list on that page  These tags are not necessarily in the one of the Canon, CanonRaw, or CanonCustom groups.  When you use $Canon:Flash in the -if option, you are asking to compare to a tag called Canon:Flash, which does not exist (see Canon tags).

When you use the options included in FAQ 3, specifically the -G (-groupNames) option, you'll see that the tag you actually want to compare is EXIF:Flash or you could have just simply used -if "$Flash eq 'Off, Did not fire'".
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jojomimi

Thanks a lot for this clarification.  Unfortunately I still don't get what I want.

exiftool -a -G1 -s _MG_2054.CR2


[ExifTool]      ExifToolVersion                 : 11.88
[System]        FileName                        : _MG_2054.CR2
[System]        Directory                       : .
[System]        FileSize                        : 23 MB
[System]        FileModifyDate                  : 2021:09:03 19:02:01+02:00
[System]        FileAccessDate                  : 2021:10:06 18:15:19+02:00
[System]        FileInodeChangeDate             : 2021:09:03 19:02:01+02:00
[System]        FilePermissions                 : rwxr-xr-x
[File]          FileType                        : CR2
[File]          FileTypeExtension               : cr2
[File]          MIMEType                        : image/x-canon-cr2
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[IFD0]          ImageWidth                      : 5184
[IFD0]          ImageHeight                     : 3456
[IFD0]          BitsPerSample                   : 8 8 8
[IFD0]          Compression                     : JPEG (old-style)
[IFD0]          Make                            : Canon
[IFD0]          Model                           : Canon EOS 1300D
[IFD0]          PreviewImageStart               : 73984
[IFD0]          Orientation                     : Horizontal (normal)
[IFD0]          PreviewImageLength              : 1531413
[IFD0]          XResolution                     : 72
[IFD0]          YResolution                     : 72
[IFD0]          ResolutionUnit                  : inches
[IFD0]          ModifyDate                      : 2021:09:03 17:07:04
[IFD0]          Copyright                       :
[IFD0]          PreviewImage                    : (Binary data 1531413 bytes, use -b option to extract)
[XMP-xmp]       Rating                          : 0
[ExifIFD]       ExposureTime                    : 1/500
[ExifIFD]       FNumber                         : 5.6
[ExifIFD]       ExposureProgram                 : Aperture-priority AE
[ExifIFD]       ISO                             : 100
[ExifIFD]       SensitivityType                 : Recommended Exposure Index
[ExifIFD]       RecommendedExposureIndex        : 100
[ExifIFD]       ExifVersion                     : 0230
[ExifIFD]       DateTimeOriginal                : 2021:09:03 17:07:04
[ExifIFD]       CreateDate                      : 2021:09:03 17:07:04
[ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
[ExifIFD]       ShutterSpeedValue               : 1/512
[ExifIFD]       ApertureValue                   : 5.7
[ExifIFD]       ExposureCompensation            : 0
[ExifIFD]       MeteringMode                    : Multi-segment
[ExifIFD]       Flash                           : Off, Did not fire
[ExifIFD]       FocalLength                     : 55.0 mm
[ExifIFD]       UserComment                     :
[ExifIFD]       SubSecTime                      : 95
[ExifIFD]       SubSecTimeOriginal              : 95
[ExifIFD]       SubSecTimeDigitized             : 95
[ExifIFD]       FlashpixVersion                 : 0100
[ExifIFD]       ColorSpace                      : Uncalibrated
[ExifIFD]       ExifImageWidth                  : 5184
[ExifIFD]       ExifImageHeight                 : 3456
[ExifIFD]       FocalPlaneXResolution           : 5728.176796
[ExifIFD]       FocalPlaneYResolution           : 5808.403361
[ExifIFD]       FocalPlaneResolutionUnit        : inches
[ExifIFD]       CustomRendered                  : Normal
[ExifIFD]       ExposureMode                    : Auto
[ExifIFD]       WhiteBalance                    : Auto
[ExifIFD]       SceneCaptureType                : Standard
[ExifIFD]       OwnerName                       : Michael Jacobs
[ExifIFD]       SerialNumber                    : 163073143329
[ExifIFD]       LensInfo                        : 55-200mm f/?
[ExifIFD]       LensModel                       : EF55-200mm f/4.5-5.6 II USM
[ExifIFD]       LensSerialNumber                : 0000000000
[Canon]         MacroMode                       : Normal
[Canon]         SelfTimer                       : Off
[Canon]         Quality                         : RAW
[Canon]         CanonFlashMode                  : Off
[Canon]         ContinuousDrive                 : Single
[Canon]         FocusMode                       : One-shot AF
[Canon]         RecordMode                      : CR2
[Canon]         CanonImageSize                  : n/a
[Canon]         EasyMode                        : Manual
[Canon]         DigitalZoom                     : None
[Canon]         Contrast                        : Normal
[Canon]         Saturation                      : Normal
[Canon]         MeteringMode                    : Evaluative
[Canon]         FocusRange                      : Not Known
[Canon]         CanonExposureMode               : Aperture-priority AE
[Canon]         LensType                        : Canon EF 55-200mm f/4.5-5.6 II USM
[Canon]         MaxFocalLength                  : 200 mm
[Canon]         MinFocalLength                  : 55 mm
[Canon]         FocalUnits                      : 1/mm
[Canon]         MaxAperture                     : 4.5
[Canon]         MinAperture                     : 23
[Canon]         FlashActivity                   : 0
[Canon]         FlashBits                       : (none)
[Canon]         ZoomSourceWidth                 : 0
[Canon]         ZoomTargetWidth                 : 0
[Canon]         ManualFlashOutput               : n/a
[Canon]         ColorTone                       : Normal
[Canon]         SRAWQuality                     : n/a
[Canon]         FocalLength                     : 55 mm
[Canon]         AutoISO                         : 100
[Canon]         BaseISO                         : 100
[Canon]         MeasuredEV                      : 14.00
[Canon]         TargetAperture                  : 5.7
[Canon]         TargetExposureTime              : 1/512
[Canon]         ExposureCompensation            : 0
[Canon]         WhiteBalance                    : Auto
[Canon]         SlowShutter                     : None
[Canon]         SequenceNumber                  : 0
[Canon]         OpticalZoomCode                 : n/a
[Canon]         CameraTemperature               : 29 C
[Canon]         FlashGuideNumber                : 0
[Canon]         FlashExposureComp               : 0
[Canon]         AutoExposureBracketing          : Off
[Canon]         AEBBracketValue                 : 0
[Canon]         ControlMode                     : Camera Local Control
[Canon]         FNumber                         : 5.7
[Canon]         ExposureTime                    : 1/512
[Canon]         MeasuredEV2                     : 14.125
[Canon]         BulbDuration                    : 0
[Canon]         CameraType                      : EOS High-end
[Canon]         NDFilter                        : n/a
[Canon]         CanonImageType                  : Canon EOS 1300D
[Canon]         CanonFirmwareVersion            : Firmware Version 1.2.0
[Canon]         OwnerName                       : Michael Jacobs
[Canon]         CanonModelID                    : EOS Rebel T6 / 1300D / Kiss X80
[Canon]         ThumbnailImageValidArea         : 0 159 7 112
[Canon]         AFAreaMode                      : Single-point AF
[Canon]         NumAFPoints                     : 9
[Canon]         ValidAFPoints                   : 9
[Canon]         CanonImageWidth                 : 5184
[Canon]         CanonImageHeight                : 3456
[Canon]         AFImageWidth                    : 5184
[Canon]         AFImageHeight                   : 3456
[Canon]         AFAreaWidths                    : 181 129 129 129 222 129 129 129 181
[Canon]         AFAreaHeights                   : 117 172 172 172 224 172 172 172 117
[Canon]         AFAreaXPositions                : 0 -839 839 -1394 0 1394 -839 839 0
[Canon]         AFAreaYPositions                : 743 393 393 0 0 0 -393 -393 -743
[Canon]         AFPointsInFocus                 : 4
[Canon]         AFPointsSelected                : 4
[Canon]         TimeZone                        : +02:00
[Canon]         TimeZoneCity                    : Paris
[Canon]         DaylightSavings                 : On
[Canon]         BracketMode                     : Off
[Canon]         BracketValue                    : 0
[Canon]         BracketShotNumber               : 0
[Canon]         RawJpgSize                      : Large
[Canon]         LongExposureNoiseReduction2     : Off
[Canon]         WBBracketMode                   : Off
[Canon]         WBBracketValueAB                : 0
[Canon]         WBBracketValueGM                : 0
[Canon]         LiveViewShooting                : Off
[Canon]         FlashExposureLock               : Off
[Canon]         LensModel                       : EF55-200mm f/4.5-5.6 II USM
[Canon]         InternalSerialNumber            : ME1826289
[Canon]         DustRemovalData                 : (Binary data 1024 bytes, use -b option to extract)
[Canon]         CropLeftMargin                  : 0
[Canon]         CropRightMargin                 : 0
[Canon]         CropTopMargin                   : 0
[Canon]         CropBottomMargin                : 0
[Canon]         AspectRatio                     : 3:2
[Canon]         CroppedImageWidth               : 5184
[Canon]         CroppedImageHeight              : 3456
[Canon]         CroppedImageLeft                : 0
[Canon]         CroppedImageTop                 : 0
[Canon]         ToneCurve                       : Standard
[Canon]         Sharpness                       : 3
[Canon]         SharpnessFrequency              : n/a
[Canon]         SensorRedLevel                  : 0
[Canon]         SensorBlueLevel                 : 0
[Canon]         WhiteBalanceRed                 : 0
[Canon]         WhiteBalanceBlue                : 0
[Canon]         ColorTemperature                : 5200
[Canon]         PictureStyle                    : Standard
[Canon]         DigitalGain                     : 0
[Canon]         WBShiftAB                       : 0
[Canon]         WBShiftGM                       : 0
[Canon]         MeasuredRGGB                    : 586 1024 1024 574
[Canon]         ColorSpace                      : Adobe RGB
[Canon]         VRDOffset                       : 0
[Canon]         SensorWidth                     : 5344
[Canon]         SensorHeight                    : 3516
[Canon]         SensorLeftBorder                : 152
[Canon]         SensorTopBorder                 : 56
[Canon]         SensorRightBorder               : 5335
[Canon]         SensorBottomBorder              : 3511
[Canon]         BlackMaskLeftBorder             : 0
[Canon]         BlackMaskTopBorder              : 0
[Canon]         BlackMaskRightBorder            : 0
[Canon]         BlackMaskBottomBorder           : 0
[Canon]         ColorDataVersion                : 14 (1300D/2000D/4000D)
[Canon]         WB_RGGBLevelsAsShot             : 2149 1024 1024 1517
[Canon]         ColorTempAsShot                 : 5522
[Canon]         WB_RGGBLevelsAuto               : 2149 1024 1024 1517
[Canon]         ColorTempAuto                   : 5522
[Canon]         WB_RGGBLevelsMeasured           : 2149 1024 1024 1517
[Canon]         ColorTempMeasured               : 5522
[Canon]         WB_RGGBLevelsDaylight           : 2068 1024 1024 1565
[Canon]         ColorTempDaylight               : 5200
[Canon]         WB_RGGBLevelsShade              : 2399 1024 1024 1334
[Canon]         ColorTempShade                  : 7000
[Canon]         WB_RGGBLevelsCloudy             : 2231 1024 1024 1440
[Canon]         ColorTempCloudy                 : 6000
[Canon]         WB_RGGBLevelsTungsten           : 1481 1024 1024 2341
[Canon]         ColorTempTungsten               : 3200
[Canon]         WB_RGGBLevelsFluorescent        : 1805 1024 1024 2217
[Canon]         ColorTempFluorescent            : 3729
[Canon]         WB_RGGBLevelsKelvin             : 2068 1024 1024 1565
[Canon]         ColorTempKelvin                 : 5189
[Canon]         WB_RGGBLevelsFlash              : 2320 1024 1024 1421
[Canon]         ColorTempFlash                  : 6333
[Canon]         AverageBlackLevel               : 2046 2046 2046 2046
[Canon]         PerChannelBlackLevel            : 2045 2046 2046 2046
[Canon]         NormalWhiteLevel                : 11767
[Canon]         SpecularWhiteLevel              : 12279
[Canon]         LinearityUpperMargin            : 10000
[Canon]         PictureStyleUserDef             : Auto; Auto; Auto
[Canon]         PictureStylePC                  : None; None; None
[Canon]         CustomPictureStyleFileName      :
[Canon]         VignettingCorrVersion           : 0
[Canon]         PeripheralLighting              : Off
[Canon]         DistortionCorrection            : Off
[Canon]         ChromaticAberrationCorr         : Off
[Canon]         ChromaticAberrationCorr         : Off
[Canon]         PeripheralLightingValue         : 0
[Canon]         DistortionCorrectionValue       : 0
[Canon]         OriginalImageWidth              : 5184
[Canon]         OriginalImageHeight             : 3456
[Canon]         PeripheralLightingSetting       : Off
[Canon]         PeripheralIlluminationCorr      : Off
[Canon]         AutoLightingOptimizer           : Off
[Canon]         AmbienceSelection               : Standard
[CanonCustom]   ExposureLevelIncrements         : 1/3 Stop
[CanonCustom]   ISOExpansion                    : Off
[CanonCustom]   FlashSyncSpeedAv                : Auto
[CanonCustom]   LongExposureNoiseReduction      : Off
[CanonCustom]   HighISONoiseReduction           : Off
[CanonCustom]   HighlightTonePriority           : Disable
[CanonCustom]   AFAssistBeam                    : Emits
[CanonCustom]   ShutterButtonAFOnButton         : Metering + AF start
[CanonCustom]   SetButtonWhenShooting           : Normal (disabled)
[CanonCustom]   FlashButtonFunction             : Raise built-in flash
[CanonCustom]   LCDDisplayAtPowerOn             : Display
[InteropIFD]    InteropIndex                    : R98 - DCF basic file (sRGB)
[InteropIFD]    InteropVersion                  : 0100
[GPS]           GPSVersionID                    : 2.3.0.0
[IFD1]          ThumbnailOffset                 : 56416
[IFD1]          ThumbnailLength                 : 17568
[IFD1]          ThumbnailImage                  : (Binary data 17568 bytes, use -b option to extract)
[IFD2]          ImageWidth                      : 668
[IFD2]          ImageHeight                     : 432
[IFD2]          BitsPerSample                   : 16 16 16
[IFD2]          Compression                     : Uncompressed
[IFD2]          PhotometricInterpretation       : RGB
[IFD2]          StripOffsets                    : 1605400
[IFD2]          SamplesPerPixel                 : 3
[IFD2]          RowsPerStrip                    : 432
[IFD2]          StripByteCounts                 : 1731456
[IFD2]          PlanarConfiguration             : Chunky
[IFD2]          SRawType                        : 3
[IFD3]          Compression                     : JPEG (old-style)
[IFD3]          StripOffsets                    : 3342104
[IFD3]          StripByteCounts                 : 20651192
[IFD3]          CR2CFAPattern                   : [Green,Blue][Red,Green]
[IFD3]          RawImageSegmentation            : 2 1728 1888
[IFD3]          SRawType                        : 1
[Composite]     DriveMode                       : Single-frame Shooting
[Composite]     ISO                             : 100
[Composite]     Lens                            : 55.0 - 200.0 mm
[Composite]     ShootingMode                    : Aperture-priority AE
[Composite]     WB_RGGBLevels                   : 2149 1024 1024 1517
[Composite]     Aperture                        : 5.6
[Composite]     BlueBalance                     : 1.481445
[Composite]     ImageSize                       : 5184x3456
[Composite]     LensID                          : Canon EF 55-200mm f/4.5-5.6 II USM
[Composite]     Megapixels                      : 17.9
[Composite]     RedBalance                      : 2.098633
[Composite]     ScaleFactor35efl                : 1.6
[Composite]     ShutterSpeed                    : 1/500
[Composite]     SubSecCreateDate                : 2021:09:03 17:07:04.95
[Composite]     SubSecDateTimeOriginal          : 2021:09:03 17:07:04.95
[Composite]     SubSecModifyDate                : 2021:09:03 17:07:04.95
[Composite]     Lens35efl                       : 55.0 - 200.0 mm (35 mm equivalent: 86.5 - 314.6 mm)
[Composite]     CircleOfConfusion               : 0.019 mm
[Composite]     FOV                             : 23.5 deg
[Composite]     FocalLength35efl                : 55.0 mm (35 mm equivalent: 86.5 mm)
[Composite]     HyperfocalDistance              : 28.28 m
[Composite]     LightValue                      : 13.9

exiftool -if "$Flash eq 'Off, Did not fire'" _MG_2054.CR2
    1 files failed condition

exiftool -if "$EXIF:Flash eq 'Off, Did not fire'" _MG_2054.CR2
    1 files failed condition

exiftool -if "$ExifIFD:Flash eq 'Off, Did not fire'" _MG_2054.CR2
    1 files failed condition

exiftool -if "$Canon:FlashActivity eq '0'" _MG_2054.CR2
    1 files failed condition

exiftool -if "$Canon:FlashActivity eq 0" _MG_2054.CR2
    1 files failed condition


I'm stuck.

Any other suggestion ?

StarGeek

On Linux/Mac you need to swap double and single quotes to avoid  shell interpreting the dollar  sign as the start of a shell  variable.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jojomimi

It works !

And how to list only the filenames of the pictures matching the condition, not the full list of Exiftool attributes of all files matching pictures ?

StarGeek

Use the -p (-printFormat) option.

exiftool -if '$Flash eq "Off, Did not fire" ' -p "$Filename" /path/to/files/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jojomimi

Great, it works fine.  It's so logic, when you know... :-)  Thanks a lot !

List pictures with flash :

exiftool -if '$Flash ne "Off, Did not fire"' -p '$Filename' .

List pictures without flash :

exiftool -if '$Flash eq "Off, Did not fire"' -p '$Filename' .