"prototype mismatch" diagnostic

Started by Shackers, February 24, 2015, 12:46:40 AM

Previous topic - Next topic

Shackers

I've been very successfully running the following  command for several months

exiftool -p -o -r -m -q -q "-filename < ${directory;s(/)(#)g;s/://}#%%f.%%e" %1

& it's now failing with the following message:-

Prototype mismatch: sub Image::ExifTool::SetFileModifyDate ($$;$$) vs ($$;$$$) at C:\Users\Beast\Appdata\Local\Temp\par-Beast\cache-exiftool-9.86/inc/lib/Image/ExifTool/Writer.pl line 1635.
Undefined Subroutine Image::ExifTool::IsDirectory called at C:\Windows/lib/Image/ExifTool.pm line 3425

(Windows 7 Pro  64bit)

Any ideas as to what's gone wrong?

Hayo Baan

Strange, those line numbers do not correspond to the same things in my version of the mentioned files. I'm also on 9.86 (running on a Mac though, but afaik these perl files do not change).

Have you tried reinstalling?
Hayo Baan – Photography
Web: www.hayobaan.nl

Shackers

Thanks for the suggestion Hayo but I'm running ExifTool from the command line so I'm not sure what kind of reinstallation you mean.  I've replaced C:\Windows\Exiftool.exe with the current version but the diagnostic persisted.

Hayo Baan

Weird, I just tried your command and it works for me. So I guess it will be up to Phil to solve :(

Sorry,
Hayo

P.S. As a side note: I don't fully understand your options; what is the purpose of the format specifier -p -o?
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

#4
That prototype changed in ExifTool 9.76.  Somehow you are using a very old version of the application or library.  Have you ever installed a Perl version of ExifTool on your system?  If so, delete it and its libraries.  Otherwise my only suggestion is to delete the temporary directory containing the unpacked ExifTool files (see step number ii in the Windows Uninstalling instructions -- on your system, the directory to delete is C:\Users\Beast\Appdata\Local\Temp\par-Beast).

Then try running version 9.86 again.

- Phil

Edit:  I have just fixed a significant but unrelated bug in 9.86.  While you are it it, you should download 9.87 and use this version instead.
...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 ($).

Shackers

Thank you again Phil - that did the trick.

NB I found that it's also essential to delete the C:\Windows\lib folder as well as the temporary directory.


Phil Harvey

Ah.  That would do it.  You must have created the c:\Windows\lib directory previously, and this could interfere with the .exe version libraries.

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

Shackers

Perhaps a cautionary tale for others who, as I did, initially install the whole package then discover we can do everything we want at the command line.  From that point on we only update the latter, leaving our \windows\lib folder as a time bomb.

Always happy to assist in discovering new ways of screwing things up....

hy

I am having the same problem on Debian Linux / Kernel: Linux 3.19.0-3.slh.3-aptosid-amd64 x86_64

exiftool -overwrite_original -Comment='SOME COMMENT' ccol_181.jpg
I am getting:
Undefined subroutine Image::ExifTool::IsDirectory called at /usr/share/perl5/Image/ExifTool.pm line 3425

any ideas? Thanks in Advance

Phil Harvey

Yes.  You have an old version of the Image::ExifTool library, installed differently somewhere else on your system.  Type "exiftool -ver" to verify this.  The problem will be solved if you can locate and delete the old libraries.

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

hy

#10
well I did a dist-upgrade this morning...

It's stating 9.74 as a version number
which exiftool shows /usr/bin/exiftool
The version number in the script found in /usr/bin is as well 9.74

in /usr/share/perl
I find two directories:
5.20.2  and
5.20

and there is another directory:
/usr/share/perl5
thanks for your help

Edit:
in /usr/share/perl
5.20 is linked to 5.20.2
In
/usr/local/bin
there is a file named
exiftool
with
my $version = '9.88';
Calling explicitly
/usr/local/bin/exiftool -overwrite_original -Comment='SOME COMMENT' ccol_181.jpg
gives the same error mentioned above

Edit2:
Calling explicitly
/usr/local/bin/exiftool -ver
I get:
9.88 [Warning: Library version is 9.74
How do I change the perl-library?

Phil Harvey

You have found the location of the application script (exiftool) but not its libraries (lib/Image/ExifTool.pm etc).  You should delete the old exiftool application as well as its libraries.  If there is no /usr/bin/lib containing these libraries, then they must be somewhere in the perl include path:

perl -e 'print "@INC\n"'

Once you find the location of ExifTool.pm version 9.74, you should delete it and the entire ExifTool directory from lib/Image.  Once you have done this, your 9.88 installation should be good to go.  To be complete, you should probably also delete lib/File/RandomAccess.pm, although this hasn't changed since 9.74 so it won't cause problems (for now...).

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

hy

Hi Phil, thanks for your help but what should I delete?
I am getting:
perl -e 'print "@INC\n"'
/etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.1 /usr/local/share/perl/5.20.1 .

Phil Harvey

You need to look at each of these directories in turn until you discover the one that contains lib/Image/ExifTool.pm version 9.74, then delete it and lib/Image/ExifTool from this directory.

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

hy

Thanks Phil, got it working again (-;

Phil Harvey

It may be useful to others if you add some details about what you did.

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

JMB

Quote from: Shackers on February 24, 2015, 02:45:01 PM
Thank you again Phil - that did the trick.

"NB I found that it's also essential to delete the C:\Windows\lib folder as well as the temporary directory. - "

Thanks, that also solved for me the problem