Issues with superseding names

Started by karanrajpal14, January 11, 2016, 09:16:38 AM

Previous topic - Next topic

karanrajpal14

Hey,
I've been trying to use your idea of superseding to deal with missing tags but it doesn't seem to be working proerly for me. Let me elaborate:

Here's the command I'm using:
exiftool -m -d %Y/%Y.%m.%d_%H.%M.%S%%-c -ext nef -ext jpg -ext jpeg \
'-testname<${File:FileModifyDate}_${Composite:ImageSize;}_${Composite:Megapixels;}MP.%le' \
'-testname<${File:FileModifyDate}_${Exif:Make;}_${Exif:Model;}_${Composite:ImageSize;}_${Composite:Megapixels;}MP.%le' \
'-testname<${Exif:DateTimeOriginal}_${Exif:Make;}_${Exif:Model;}_${Composite:ImageSize;}_${Composite:Megapixels;}MP.%le' \
'-testname<${Exif:DateTimeOriginal}_${Exif:Make;}_${Exif:Model;}_${Composite:ImageSize;}_${Composite:Megapixels;}MP_${MakerNotes:FileNumber;}.%le' *.jpg


Here's the output:
'2011.10.13_04.38.43_SONY_DSC-W530_4320x3240_14.0MP.jpg' --> '2011/2011.10.13_04.38.43_SONY_DSC-W530_4320x3240_14.0MP_.jpg'
'2011.10.13_04.39.05_SONY_DSC-W530_4320x3240_14.0MP.jpg' --> '2011/2011.10.13_04.39.05_SONY_DSC-W530_4320x3240_14.0MP_.jpg'
'2011.10.13_04.40.05_SONY_DSC-W530_4320x3240_14.0MP.jpg' --> '2011/2011.10.13_04.40.05_SONY_DSC-W530_4320x3240_14.0MP_.jpg'
'2011.10.13_06.36.23-1_SONY_DSC-W530_4320x3240_14.0MP_.jpg' --> '2011/2011.10.13_06.36.23_SONY_DSC-W530_4320x3240_14.0MP_.jpg'
'2011.10.13_06.38.29-1_SONY_DSC-W530_4320x3240_14.0MP_.jpg' --> '2011/2011.10.13_06.38.29_SONY_DSC-W530_4320x3240_14.0MP_.jpg'
'2011.10.13_06.38.40-1_SONY_DSC-W530_4320x3240_14.0MP_.jpg' --> '2011/2011.10.13_06.38.40_SONY_DSC-W530_4320x3240_14.0MP_.jpg'


And here's the metadata for one of those files:
exiftool -s -G 2011.10.13_04.38.43_SONY_DSC-W530_4320x3240_14.0MP_.jpg
[ExifTool]      ExifToolVersion                 : 10.00
[File]          FileName                        : 2011.10.13_04.38.43_SONY_DSC-W530_4320x3240_14.0MP_.jpg
[File]          Directory                       : .
[File]          FileSize                        : 4.4 MB
[File]          FileModifyDate                  : 2011:10:13 04:38:46+05:30
[File]          FileAccessDate                  : 2016:01:10 20:57:48+05:30
[File]          FileInodeChangeDate             : 2016:01:10 22:15:12+05:30
[File]          FilePermissions                 : rw-r--r--
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[File]          ImageWidth                      : 4320
[File]          ImageHeight                     : 3240
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:2 (2 1)
[EXIF]          ImageDescription                :
[EXIF]          Make                            : SONY
[EXIF]          Model                           : DSC-W530
[EXIF]          Orientation                     : Horizontal (normal)
[EXIF]          XResolution                     : 72
[EXIF]          YResolution                     : 72
[EXIF]          ResolutionUnit                  : inches
[EXIF]          ModifyDate                      : 2011:10:13 04:38:43
[EXIF]          YCbCrPositioning                : Co-sited
[EXIF]          ExposureTime                    : 1/30
[EXIF]          FNumber                         : 2.7
[EXIF]          ExposureProgram                 : Program AE
[EXIF]          ISO                             : 250
[EXIF]          ExifVersion                     : 0221
[EXIF]          DateTimeOriginal                : 2011:10:13 04:38:43
[EXIF]          CreateDate                      : 2011:10:13 04:38:43
[EXIF]          ComponentsConfiguration         : Y, Cb, Cr, -
[EXIF]          CompressedBitsPerPixel          : 3
[EXIF]          ExposureCompensation            : 0
[EXIF]          MaxApertureValue                : 2.7
[EXIF]          MeteringMode                    : Multi-segment
[EXIF]          LightSource                     : Unknown
[EXIF]          Flash                           : Auto, Fired, Red-eye reduction, Return detected
[EXIF]          FocalLength                     : 4.7 mm
[EXIF]          FlashpixVersion                 : 0100
[EXIF]          ColorSpace                      : sRGB
[EXIF]          ExifImageWidth                  : 4320
[EXIF]          ExifImageHeight                 : 3240
[EXIF]          InteropIndex                    : R98 - DCF basic file (sRGB)
[EXIF]          InteropVersion                  : 0100
[EXIF]          FileSource                      : Digital Camera
[EXIF]          SceneType                       : Directly photographed
[EXIF]          CustomRendered                  : Normal
[EXIF]          ExposureMode                    : Auto
[EXIF]          WhiteBalance                    : Auto
[EXIF]          SceneCaptureType                : Standard
[EXIF]          Contrast                        : Normal
[EXIF]          Saturation                      : Normal
[EXIF]          Sharpness                       : Normal
[EXIF]          Compression                     : JPEG (old-style)
[EXIF]          ThumbnailOffset                 : 5700
[EXIF]          ThumbnailLength                 : 8784
[MakerNotes]    CreativeStyle                   : Standard
[MakerNotes]    Macro                           : Off
[MakerNotes]    FocusMode                       : Permanent-AF
[MakerNotes]    AFAreaMode                      : Face Tracking
[MakerNotes]    AFIlluminator                   : Auto
[MakerNotes]    JPEGQuality                     : Standard
[MakerNotes]    FlashLevel                      : Normal
[MakerNotes]    ReleaseMode                     : Normal
[MakerNotes]    SequenceNumber                  : Single
[MakerNotes]    Anti-Blur                       : Off
[MakerNotes]    DynamicRangeOptimizer           : Standard
[MakerNotes]    HighISONoiseReduction2          : Normal
[MakerNotes]    IntelligentAuto                 : On
[PrintIM]       PrintIMVersion                  : 0300
[MPF]           MPFVersion                      : 0100
[MPF]           NumberOfImages                  : 2
[MPF]           MPImageFlags                    : Dependent child image
[MPF]           MPImageFormat                   : JPEG
[MPF]           MPImageType                     : Large Thumbnail (full HD equivalent)
[MPF]           MPImageLength                   : 617959
[MPF]           MPImageStart                    : 4018137
[MPF]           DependentImage1EntryNumber      : 0
[MPF]           DependentImage2EntryNumber      : 0
[MPF]           ImageUIDList                    : (Binary data 66 bytes, use -b option to extract)
[MPF]           TotalFrames                     : 1
[Composite]     Aperture                        : 2.7
[Composite]     ImageSize                       : 4320x3240
[Composite]     PreviewImage                    : (Binary data 617959 bytes, use -b option to extract)
[Composite]     Megapixels                      : 14.0
[Composite]     ShutterSpeed                    : 1/30
[Composite]     ThumbnailImage                  : (Binary data 8784 bytes, use -b option to extract)
[Composite]     FocalLength35efl                : 4.7 mm
[Composite]     LightValue                      : 6.5


As you can see, the tag MakerNotes:FileNumber doesn't exist for this file which means that it should move to the expression above and an underscore shouldn't be appened to the end of the file name. Correct? But this isn't how it's happeneing. Any idea on what I'm doing wrong? Any help would be appreciated. Thanks!

Phil Harvey

This is because you are using the -m option:

            If a specified tag does not exist, a minor warning is issued and
            the line with the missing tag is not printed.  However, the -f
            option may be used to set the value of missing tags to '-' (but
            this may be configured via the MissingTagValue API option), or the
            -m option may be used to ignore minor warnings and leave the
            missing values empty
.


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).