ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Shackers on February 24, 2015, 12:46:40 AM

Title: "prototype mismatch" diagnostic
Post by: Shackers on February 24, 2015, 12:46:40 AM
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?
Title: Re: "prototype mismatch" diagnostic
Post by: Hayo Baan on February 24, 2015, 03:08:18 AM
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?
Title: Re: "prototype mismatch" diagnostic
Post by: Shackers on February 24, 2015, 03:47:06 AM
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.
Title: Re: "prototype mismatch" diagnostic
Post by: Hayo Baan on February 24, 2015, 04:58:53 AM
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?
Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on February 24, 2015, 07:05:56 AM
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 (https://exiftool.org/install.html#Windows) -- 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.
Title: Re: "prototype mismatch" diagnostic
Post by: 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.

Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on February 24, 2015, 08:22:15 PM
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
Title: Re: "prototype mismatch" diagnostic
Post by: Shackers on February 25, 2015, 04:15:16 PM
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....
Title: Re: "prototype mismatch" diagnostic
Post by: hy on April 08, 2015, 07:04:55 AM
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
Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on April 08, 2015, 10:32:27 AM
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
Title: Re: "prototype mismatch" diagnostic
Post by: hy on April 08, 2015, 02:33:46 PM
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?
Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on April 08, 2015, 05:36:40 PM
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

Title: Re: "prototype mismatch" diagnostic
Post by: hy on April 10, 2015, 01:35:49 PM
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 .
Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on April 10, 2015, 01:45:31 PM
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
Title: Re: "prototype mismatch" diagnostic
Post by: hy on April 11, 2015, 08:21:11 AM
Thanks Phil, got it working again (-;
Title: Re: "prototype mismatch" diagnostic
Post by: Phil Harvey on April 11, 2015, 08:28:57 AM
It may be useful to others if you add some details about what you did.

- Phil
Title: Re: "prototype mismatch" diagnostic
Post by: JMB on May 23, 2020, 07:58:34 AM
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