Uninitialized variable

Started by Neal Krawetz, November 04, 2021, 04:06:32 PM

Previous topic - Next topic

Neal Krawetz

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.

StarGeek

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.
"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

Neal Krawetz

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.



Alan Clifford

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   ;)

Neal Krawetz

If you don't redirect stderr to stdout, then it just scrolls off the screen really fast.
But it's still there.

Phil Harvey

Hi Neal,

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

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