Image::Magick 6.77 fails to install on windows [with patch]

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
Mithaldu
Posts: 6
Joined: 2012-06-09T14:43:03-07:00
Authentication code: 13

Image::Magick 6.77 fails to install on windows [with patch]

Post by Mithaldu »

I installed this version of ImageMagick: ImageMagick-6.7.7-6-Q16-windows-dll.exe

Then i tried to install Image::Magick via CPAN, but it was still unable to find the header files.

On inspection with procmon it turned out that it was trying to look for them like this: C:\Program Files (x86)\include\magick\MagickCore.h

Inspection of Makefile.PL turned out that it was trying to find the IM dir based on this line:

Code: Select all

Path: C:\Program Files (x86)\ImageMagick-6.7.7-Q16\configure.xml
Using this kind of code:

Code: Select all

      push @l, catfile($dirpath,'..','lib');
The following diff fixes that problem:

Code: Select all

d96061efca0ff6cb104584682eccce20721aa851
 Makefile.PL |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile.PL b/Makefile.PL
index 887c5ed..a250698 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,12 +44,15 @@ sub AutodetectWin32gcc {
       my (@l,@b,@i) = ( (),(),() );
 
       # try to detect 'lib' dir
+      push @l, catfile($dirpath,'lib');
       push @l, catfile($dirpath,'..','lib');
       push @l, catfile($dirpath,'..','..','lib');
       push @l, catfile($dirpath,'..','..','..','lib');
       foreach (@l) { push @libdir, $_ if (-d $_) };
 
       # try to detect 'bin' dir
+      push @b, catfile($dirpath);
+      push @b, catfile($dirpath,'bin');
       push @b, catfile($dirpath,'..');
       push @b, catfile($dirpath,'..','bin');
       push @b, catfile($dirpath,'..','..');
@@ -59,6 +62,8 @@ sub AutodetectWin32gcc {
       foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") };
 
       # try to detect 'include' dir
+      push @i, catfile($dirpath,'include');
+      push @i, catfile($dirpath,'include','ImageMagick');
       push @i, catfile($dirpath,'..','include');
       push @i, catfile($dirpath,'..','include','ImageMagick');
       push @i, catfile($dirpath,'..','..','include');
Sadly this fixes not all the problems though, since all the tests still fail due to mismatches in the signatures.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Image::Magick 6.77 fails to install on windows [with pat

Post by magick »

Thanks for the patches. In the mean-time, you can install PerlMagick when you install the ImageMagick Window's binaries. That should work, it certainly does for us.
Mithaldu
Posts: 6
Joined: 2012-06-09T14:43:03-07:00
Authentication code: 13

Re: Image::Magick 6.77 fails to install on windows [with pat

Post by Mithaldu »

Thanks for the quick answer and for accepting the patch.

As for the version with the ImageMagick installer: Not an option for me. I also need Win32::Process::Memory which does not work under ActivePerl, so i'm using Strawberry Perl 5.16.0.1 (32bit).

For what it's worth: I ignored the further test failures and installed the Image::Magick that got compiled and it seems to be working fine. Kind of looks like the signature differences are a fluke and the rest of the functionality is fine.
Post Reply