2016-01-06 Perl Image Magic on OSX

Something’s wrong on my system...

alex@Megabombus:~$ perl -version

This is perl 5, version 22, subversion 0 (v5.22.0) built for darwin-2level

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.

alex@Megabombus:~$ cpanm Image::Magick
--> Working on Image::Magick
Fetching http://www.cpan.org/authors/id/J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz ... OK
Configuring PerlMagick-6.89-1 ... OK
Building and testing Image-Magick-6.89 ... FAIL
! Installing Image::Magick failed. See /Users/alex/.cpanm/work/1452366085.8233/build.log for details. Retry with --force to force install it.
alex@Megabombus:~$ cat /Users/alex/.cpanm/work/1452366085.8233/build.log
cpanm (App::cpanminus) 1.7039 on perl 5.022000 built for darwin-2level
Work directory is /Users/alex/.cpanm/work/1452366085.8233
You have make /usr/bin/make
You have LWP 6.13
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching Image::Magick () on cpanmetadb ...
--> Working on Image::Magick
Fetching http://www.cpan.org/authors/id/J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz
-> OK
Unpacking PerlMagick-6.89-1.tar.gz
Entering PerlMagick-6.89
META.yml/json not found. Creating skeleton for it.
Configuring PerlMagick-6.89-1
Running Makefile.PL
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lperl
Generating a Unix-style Makefile
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.10)
Building and testing Image-Magick-6.89
cp Magick.pm blib/lib/Image/Magick.pm
AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick)
Running Mkbootstrap for Image::Magick ()
chmod 644 "Magick.bs"
"/Users/alex/perl5/perlbrew/perls/perl-5.22.0/bin/perl" "/Users/alex/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/ExtUtils/xsubpp"  -typemap "/Users/alex/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/ExtUtils/typemap" -typemap "typemap"  Magick.xs > Magick.xsc && mv Magick.xsc Magick.c
cc -c  -I/usr/local/include/ImageMagick-6 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libxml2 -I"/usr/include/ImageMagick-6" -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/usr/include/freetype2 -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -O3   -DVERSION=\"6.89\" -DXS_VERSION=\"6.89\"  "-I/Users/alex/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/CORE"  -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs:4856:45: warning: address of array 'info->image_info->filename' will always evaluate to 'true' [-Wpointer-bool-conversion]
              if (info && info->image_info->filename &&
                       ~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~
1 warning generated.
rm -f blib/arch/auto/Image/Magick/Magick.bundle
LD_RUN_PATH="/usr/local/lib" env MACOSX_DEPLOYMENT_TARGET=10.3 cc  -L/usr/local/lib -lMagickCore-6.Q16  -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong  Magick.o  -o blib/arch/auto/Image/Magick/Magick.bundle 	\
	   -L/usr/local/lib -lMagickCore-6.Q16 -lm  	\

ld: warning: object file (Magick.o) was built for newer OSX version (10.10) than being linked (10.4)
chmod 755 blib/arch/auto/Image/Magick/Magick.bundle
"/Users/alex/perl5/perlbrew/perls/perl-5.22.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Magick.bs blib/arch/auto/Image/Magick/Magick.bs 644
Manifying 1 pod document
Running Mkbootstrap for Image::Magick ()
chmod 644 "Magick.bs"
PERL_DL_NONLAZY=1 "/Users/alex/perl5/perlbrew/perls/perl-5.22.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/bzlib/*.t t/jpeg/*.t t/jng/*.t t/mpeg/*.t t/png/*.t t/tiff/*.t t/zlib/*.t
t/blob.t .......... ok
t/bzlib/read.t .... ok
t/bzlib/write.t ... ok
t/composite.t ..... ok
t/filter.t ........
Failed 1/58 subtests
t/getattribute.t .. ok
t/jng/read.t ...... ok
t/jng/write.t ..... ok
t/jpeg/read.t ..... ok
t/jpeg/write.t .... ok
t/montage.t ....... ok
t/mpeg/read.t .....
Failed 2/2 subtests
t/ping.t .......... ok
t/png/read-16.t ... ok
t/png/read.t ...... ok
t/png/write-16.t .. ok
t/png/write.t ..... ok
t/read.t .......... ok
t/setattribute.t .. ok
t/tiff/read.t ..... ok
t/tiff/write.t .... ok
t/write.t ......... ok
t/zlib/read.t ..... ok
t/zlib/write.t .... ok

Test Summary Report
-------------------
t/filter.t      (Wstat: 0 Tests: 58 Failed: 1)
  Failed test:  47
t/mpeg/read.t   (Wstat: 0 Tests: 2 Failed: 2)
  Failed tests:  1-2
Files=24, Tests=355, 18 wallclock secs ( 0.20 usr  0.09 sys +  5.62 cusr  1.08 csys =  6.99 CPU)
Result: FAIL
Failed 2/24 test programs. 3/355 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing Image::Magick failed. See /Users/alex/.cpanm/work/1452366085.8233/build.log for details. Retry with --force to force install it.
Expiring 2 work directories.
alex@Megabombus:~$ cd /Users/alex/.cpanm/work/1452366085.8233/PerlMagick-6.89/
r.t | grep -A3 -B3 "not ok"
ok 46
Segment() ...
  mean-error=0.0698270573404052, maximum-error=0.827450980392157
not ok 47
Shade(geometry=>'30x30',gray=>'true') ...
ok 48
Sharpen('0.0x1.0') ...
alex@Megabombus:~/.cpanm/work/1452366085.8233/PerlMagick-6.89$ PERL_DL_NONLAZY=1 "/Users/alex/perl5/perlbrew/perls/perl-5.22.0/bin/perl" -Mblib=blib t/mpeg/read.t | grep -A3 -B3 "not ok"
     Depth:    16
  testing reading from BLOB with magick "PAM"...
BlobToImage input.m2v: Exception 425: improper image header `' @ error/pnm.c/ReadPNMImage/284
not ok 1
  testing reading from file "input.mpg" ...
ReadImage()
Image: input.mpg, signatures do not match.
--
--
     Depth:    16
  testing reading from BLOB with magick "PAM"...
BlobToImage input.mpg: Exception 425: improper image header `' @ error/pnm.c/ReadPNMImage/284
not ok 2
alex@Megabombus:~/.cpanm/work/1452366085.8233/PerlMagick-6.89$ cd
alex@Megabombus:~$ cpanm --notest Image::Magick
--> Working on Image::Magick
Fetching http://www.cpan.org/authors/id/J/JC/JCRISTY/PerlMagick-6.89-1.tar.gz ... OK
Configuring PerlMagick-6.89-1 ... OK
Building Image-Magick-6.89 ... OK
Successfully installed Image-Magick-6.89
1 distribution installed

I’ve got a *bad* feeling about this!

Well, as it turns out, Claudia talked me out of switching from GD to Image::Magick and so the entire thing isn’t really that urgent.

​#Perl