Incorrect file size with exiftool 12.42

Started by morozgrafix, June 06, 2022, 02:22:07 PM

Previous topic - Next topic

morozgrafix

Hello Phil, I'm a maintainer of the https://github.com/exiftool-rb/exiftool_vendored.rb Ruby Gem and in the process of upgrading to version 12.42 I've noticed some test failures. I found a difference in the output between the versions and wanted to bring it up to your attention.

Issue: exiftool v12.42 shows different output for "File Size" and "File Permissions" from prior versions for the same file.

exiftool v12.42 gives following output (full output below):
ExifTool Version Number         : 12.42
File Name                       : Panasonic.jpg
Directory                       : bin/t/images
File Size                       : 7.1 kB
File Modification Date/Time     : 2006:01:04 11:02:27-08:00
File Access Date/Time           : 2022:06:06 10:41:38-07:00
File Inode Change Date/Time     : 2022:06:06 10:41:35-07:00
File Permissions                : -rw-r--r--
...


prior versions up to 12.41 show different File Size and File Permissions output (here tested with 12.06 full output is also below):

ExifTool Version Number         : 12.06
File Name                       : Panasonic.jpg
Directory                       : bin/t/images
File Size                       : 6.9 kB
File Modification Date/Time     : 2006:01:04 11:02:27-08:00
File Access Date/Time           : 2022:06:06 10:41:38-07:00
File Inode Change Date/Time     : 2022:06:06 10:41:35-07:00
File Permissions                : rw-r--r--
...


I'm testing on macOS Monterey 12.4 (21F79)

The file in question is part of the distro, t/images/Panasonic.jpg and it shows at 6.9K on my filesystem:
$ ls -la bin/t/images/Panasonic.jpg
-rw-r--r--  1 sergey  staff   6.9K Jan  4  2006 bin/t/images/Panasonic.jpg




Full Output v12.42:
./bin/exiftool bin/t/images/Panasonic.jpg
ExifTool Version Number         : 12.42
File Name                       : Panasonic.jpg
Directory                       : bin/t/images
File Size                       : 7.1 kB
File Modification Date/Time     : 2006:01:04 11:02:27-08:00
File Access Date/Time           : 2022:06:06 10:41:38-07:00
File Inode Change Date/Time     : 2022:06:06 10:41:35-07:00
File Permissions                : -rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : Panasonic
Camera Model Name               : DMC-FZ3
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Modify Date                     : 2004:08:28 15:55:46
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/400
F Number                        : 4.0
Exposure Program                : Program AE
ISO                             : 80
Exif Version                    : 0220
Date/Time Original              : 2004:08:28 15:55:46
Create Date                     : 2004:08:28 15:55:46
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 4
Exposure Compensation           : 0
Max Aperture Value              : 2.8
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 4.6 mm
Image Quality                   : High
Firmware Version                : 0.1.0.8
White Balance                   : Auto
Focus Mode                      : Auto
AF Area Mode                    : 9-area
Image Stabilization             : On, Mode 2
Macro Mode                      : Off
Shooting Mode                   : Program
Audio                           : No
Data Dump                       : (Binary data 5428 bytes, use -b option to extract)
White Balance Bias              : 0
Flash Bias                      : 0
Internal Serial Number          : (S00) 2004:07:19 no. 0102
Panasonic Exif Version          : 0100
Video Frame Rate                : n/a
Color Effect                    : Off
Time Since Power On             : 00:00:06.96
Burst Mode                      : Off
Sequence Number                 : 0
Contrast Mode                   : Normal
Noise Reduction                 : Standard
Self Timer                      : Off
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 2016
Exif Image Height               : 1512
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 0
Focal Length In 35mm Format     : 35 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
PrintIM Version                 : 0250
Compression                     : JPEG (old-style)
Thumbnail Offset                : 6822
Thumbnail Length                : 28
Image Width                     : 8
Image Height                    : 8
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 4.0
Image Size                      : 8x8
Megapixels                      : 0.000064
Scale Factor To 35 mm Equivalent: 7.6
Shutter Speed                   : 1/400
Thumbnail Image                 : (Binary data 28 bytes, use -b option to extract)
Circle Of Confusion             : 0.004 mm
Field Of View                   : 54.4 deg
Focal Length                    : 4.6 mm (35 mm equivalent: 35.0 mm)
Hyperfocal Distance             : 1.34 m
Light Value                     : 13.0


Full Output v12.06:
/usr/local/bin/exiftool bin/t/images/Panasonic.jpg
ExifTool Version Number         : 12.06
File Name                       : Panasonic.jpg
Directory                       : bin/t/images
File Size                       : 6.9 kB
File Modification Date/Time     : 2006:01:04 11:02:27-08:00
File Access Date/Time           : 2022:06:06 10:41:38-07:00
File Inode Change Date/Time     : 2022:06:06 10:41:35-07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : Panasonic
Camera Model Name               : DMC-FZ3
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Modify Date                     : 2004:08:28 15:55:46
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/400
F Number                        : 4.0
Exposure Program                : Program AE
ISO                             : 80
Exif Version                    : 0220
Date/Time Original              : 2004:08:28 15:55:46
Create Date                     : 2004:08:28 15:55:46
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 4
Exposure Compensation           : 0
Max Aperture Value              : 2.8
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 4.6 mm
Image Quality                   : High
Firmware Version                : 0.1.0.8
White Balance                   : Auto
Focus Mode                      : Auto
AF Area Mode                    : 9-area
Image Stabilization             : On, Mode 2
Macro Mode                      : Off
Shooting Mode                   : Program
Audio                           : No
Data Dump                       : (Binary data 5428 bytes, use -b option to extract)
White Balance Bias              : 0
Flash Bias                      : 0
Internal Serial Number          : (S00) 2004:07:19 no. 0102
Panasonic Exif Version          : 0100
Video Frame Rate                : n/a
Color Effect                    : Off
Time Since Power On             : 00:00:06.96
Burst Mode                      : Off
Sequence Number                 : 0
Contrast Mode                   : Normal
Noise Reduction                 : Standard
Self Timer                      : Off
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 2016
Exif Image Height               : 1512
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 0
Focal Length In 35mm Format     : 35 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
PrintIM Version                 : 0250
Compression                     : JPEG (old-style)
Thumbnail Offset                : 6822
Thumbnail Length                : 28
Image Width                     : 8
Image Height                    : 8
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 4.0
Image Size                      : 8x8
Megapixels                      : 0.000064
Scale Factor To 35 mm Equivalent: 7.6
Shutter Speed                   : 1/400
Thumbnail Image                 : (Binary data 28 bytes, use -b option to extract)
Circle Of Confusion             : 0.004 mm
Field Of View                   : 54.4 deg
Focal Length                    : 4.6 mm (35 mm equivalent: 35.0 mm)
Hyperfocal Distance             : 1.34 m
Light Value                     : 13.0

morozgrafix

Doh! I just read release notes and noticed
QuoteChanged ExifTool FileSize print conversion to use kB/MB/GB units instead of KiB/MiB/GiB
point. Dug a little bit deeper and found that the file is 7099 bytes which is 7099 / 1000 = 7.099 KB or 7099 / 1024 = 6.9326171875 KiB

It seems that it is working as expected and it's not an issue. I will update my test expectations for the file size.

I'm still not sure why there is a difference in the File Permissions output.

Phil Harvey

Nov. 27, 2020 - Version 12.11
  - Changed FileSize conversion to use binary prefixes since that is how the
    conversion is currently done (eg. MiB instead of MB)

Feb. 18, 2021 - Version 12.19
  - Enhanced FilePermissions to include device type (similar to "ls -l")

June 1, 2022 - Version 12.42 (production release)
  - Changed ExifTool FileSize print conversion to use kB/MB/GB units instead of
    KiB/MiB/GiB


There was a transition period from Nov 2020 to June 2022 when the FileSize unit strings were changed to reflect the existing 1024-based numbers.  But now the numbers and the unit strings have been changed to 1000-based.

- 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 ($).

morozgrafix

Thanks Phil, I missed that line in the change log when I posted and then found it right after initial report.