perl - Error Image::Compare (jpg files) -
perl - Error Image::Compare (jpg files) -
i'm trying utilize image::compare
in perl compare 2 images based on colors used in images. here code i'm using:
#!/usr/bin/perl utilize strict; utilize warnings; utilize image::compare; ($cmp) = image::compare->new(); $cmp->set_image1( img => "$argv[0]", type => 'jpg', ); $cmp->set_image2( img => "$argv[1]", type => 'jpg', ); $cmp->set_method( method => &image::compare::threshold, args => 70, ); if ( $cmp->compare() ) { print "same \n"; } else { print "not same\n"; }
when run it, gave error:
unable read image info file 'test_002.jpg': 'format 'jpg' not supported - formats bmp, ico, pnm, raw, sgi, tga available reading - can't locate imager/file/jpg.pm or imager/file/jpgreader.pm' @ /usr/local/share/perl/5.18.2/image/compare.pm line 162.
i've tried install imager::file::jpeg
, gave me errors:
$ cpan install imager::file::jpeg reading '/home/b0y/.cpan/metadata' database generated on sat, 18 oct 2014 07:05:12 gmt running install module 'imager::file::jpeg' running create t/to/tonyc/imager-file-jpeg-0.88.tar.gz checksum /home/b0y/.cpan/sources/authors/id/t/to/tonyc/imager-file-jpeg-0.88.tar.gz ok
cpan.pm: building t/to/tonyc/imager-file-jpeg-0.88.tar.gz
jpeg: building independently jpeg: main: includes not found - libraries found jpeg: checking if compiler can find them on own jpeg: test code failed: can't link/include 'jpeglib.h', 'jpeg' os unsupported: jpeg libraries or headers not found warning: no success on command[/usr/bin/perl makefile.pl installdirs=site] tonyc/imager-file-jpeg-0.88.tar.gz /usr/bin/perl makefile.pl installdirs=site -- not ok running create test create had problems, won't test running create install create had problems, won't install not read metadata file. falling other methods determine prerequisites
many thanks.
you need install "libjpeg-dev",
sudo apt-get install libjpeg-dev
image perl compare jpeg
Comments
Post a Comment