ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Neal Krawetz on November 04, 2021, 04:06:32 PM

Title: Uninitialized variable
Post by: Neal Krawetz on November 04, 2021, 04:06:32 PM
I have a sample picture that outputs:

Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at lib/Image/ExifTool.pm line 8715, <EXIFTOOL_FILE> chunk 3.

The picture:
https://fotoforensics.com/analysis.php?id=9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133&fmt=orig

This happens on ExifTool 12.06, 12.33 and probably lots of earlier versions.
Title: Re: Uninitialized variable
Post by: StarGeek on November 04, 2021, 04:11:09 PM
What command are you using?  What OS?

I downloaded that image and ran
exiftool -g1 -a -s Y:\!temp\aa\9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133.jpg
on it and the output was normal.
Title: Re: Uninitialized variable
Post by: Neal Krawetz on November 04, 2021, 04:43:55 PM
OS: Linux

Command-line: exiftool -g 9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133.jpg 2>&1 | less

I tried your command line:
  exiftool -g1 -a -s 9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133.jpg 2>&1 | less
I see the same uninitialized variables.


Title: Re: Uninitialized variable
Post by: Alan Clifford on November 04, 2021, 05:08:24 PM
I get that when stderr is redirected to stdout.  On a mac. So what is happening to stderr if you don't use 2>&1 ?

cellini:temp alan$ exiftool -g1 -a -s ~/temp/9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133.jpg 2>&1 
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
Use of uninitialized value $val in bitwise and (&) at /Library/Perl/5.30/Image/ExifTool.pm line 8563, <EXIFTOOL_FILE> chunk 3.
---- ExifTool ----
ExifToolVersion                 : 12.16
---- System ----
FileName                        : 9cf0106aa5cc2cabb5c92a56d785aa02a01aef55.6728133.jpg
Directory                       : /Users/alan/temp


Disclaimer:  I've had a glass or two of South African red so I may not be functioning correctly   ;)
Title: Re: Uninitialized variable
Post by: Neal Krawetz on November 04, 2021, 07:05:10 PM
If you don't redirect stderr to stdout, then it just scrolls off the screen really fast.
But it's still there.
Title: Re: Uninitialized variable
Post by: Phil Harvey on November 04, 2021, 10:20:46 PM
Hi Neal,

Thanks.  I can reproduce this and it will be fixed in 12.35

- Phil