DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

Hello All,

I posted this question to the PerlMagick forum, and thought I would try my luck here. I'm not sure if this is a bug, but Windows and Perl are complaining about the DLLs that come with the Windows distributions.

I'm running Perl v5.20.2 built for MSWin32-x64-multi-thread on a 64-bit Windows Server 2008 R2 Enterprise machine. I had been using PerlMagick installed with the DLLs that came with ImageMagick v6.9.3 without issue, but I can't get the same script to work with the DLLs from v7.0.1-6, v7.0.1-8, and v7.0.1-9. I am sure that I'm downloading the proper distributions (those specified to work on 64-bit Windows machines).

When I run the script, an error dialogue box titled "perl.exe - Bad Image" pops up with the following message:
C:\Strawberry\perl\site\lib\auto\Image\Magick\Magick.xs.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original media or contact your system administrator or software vendor for support
After clicking "ok" on the dialogue box, Perl continues with this output to STDERR:

Code: Select all

W:\>perl \Scripts\check_imgs.pl 001.tif
Can't load 'C:/Strawberry/perl/site/lib/auto/Image/Magick/Magick.xs.dll' for module Image::Magick: load_file:%1 is not a valid Win32 application at C:/Strawberry/perl/lib/DynaLoader.pm line 193. at \Scripts\check_imgs.pl line 16.
Compilation failed in require at \Scripts\check_imgs.pl line 16.
BEGIN failed--compilation aborted at \Scripts\check_imgs.pl line 16.
Line 16 of the script is just loading the module. Similarly, a command line script that only tries to load the Perl module fails with the same results.

Code: Select all

perl -e "use Image::Magick"
Could it be that a DLL built for a 32-bit system made its way into the 64-bit distribution?

For what it's worth, simple testing of the "magick" command has been successful.

Thank you very much.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by dlemstra »

Did you install thee 64-bit version of StrawberryPerl?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

Yup yup -- the Perl version is the same now as it was when all my scripts worked, which was when they ran off the DLLs from ImageMagick v6.9.3. I unfortunately cannot roll back to the version that worked because of the exploit which v7+ fixed.

The version is Strawberry Perl v5.20.2 for 64-bit Windows machines.

Code: Select all

C:\>perl -v

This is perl 5, version 20, subversion 2 (v5.20.2) built for MSWin32-x64-multi-thread

Copyright 1987-2015, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

I tried the 7.0.2-0 distribution today, and I'm still getting the same error. Has anyone been able to run PerlMagick on a 64-bit Windows machine with IM v7?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by dlemstra »

I don't understand why this fails. We use the 64 bit version of Strawberry perl (https://ci.appveyor.com/project/dlemstr ... lcy4d#L108) and it builds without any problems (https://ci.appveyor.com/project/dlemstr ... y4d#L12066). I will try to set up a virtual machine and try to get it working myself, might be a while before I will be able to work on that.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
element22
Posts: 4
Joined: 2016-09-14T04:58:33-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by element22 »

goldfish wrote:
C:\Strawberry\perl\site\lib\auto\Image\Magick\Magick.xs.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original media or contact your system administrator or software vendor for support
I get the same error (Win7 64, Strawberry Perl 5.20 64-bit) with ImageMagick 7.0.3 Q8 64. Are there any fixes for this? Alternatively, goldfish, do you still have the ImageMagick v6.9.3 install file that was working for you? I can't locate it online.
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

element22 wrote:
goldfish wrote:
C:\Strawberry\perl\site\lib\auto\Image\Magick\Magick.xs.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original media or contact your system administrator or software vendor for support
I get the same error (Win7 64, Strawberry Perl 5.20 64-bit) with ImageMagick 7.0.3 Q8 64. Are there any fixes for this? Alternatively, goldfish, do you still have the ImageMagick v6.9.3 install file that was working for you? I can't locate it online.
Hi -- sorry, haven't checked back on this in a while. I just tried with the ImageMagick-7.0.3-2-Q16-x64-dll.exe installer and got the same error myself, and as far as I know there are no fixes for this. I think I'm going to post something to StackOverflow just in case someone there knows something I don't, and if I get around to that today I'll cross post the link to that discussion.

As for the v6.9.3 installer... unfortunately, I'm in the same boat. I don't think I've got it sitting around anymore because my company's IT nuked it everywhere they could find it. I'll let you know if I happen to come across it though.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by dlemstra »

The dll that is created looks incorrect. For some reason it is creating an executable instead of a dll. I will have to investigate what is happening on AppVeyor to figure out why it breaks.

EDIT: I figured out why it breaks. Not sure how to fix it yet though :)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

dlemstra wrote:The dll that is created looks incorrect. For some reason it is creating an executable instead of a dll. I will have to investigate what is happening on AppVeyor to figure out why it breaks.

EDIT: I figured out why it breaks. Not sure how to fix it yet though :)
Hey, that's a big step in the right direction! Thank you, and best of luck!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by dlemstra »

Can you give it a try with the latest installer? I haven't had time to test it myself but you should now be able to use PerlMagick again.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
goldfish
Posts: 10
Joined: 2016-05-29T19:53:16-07:00
Authentication code: 1151

Re: DLL Problems in 64-Bit Windows v7.0.1-x Distributions

Post by goldfish »

dlemstra wrote:Can you give it a try with the latest installer? I haven't had time to test it myself but you should now be able to use PerlMagick again.
Definitely! I will give it a shot a little later today.
Post Reply