title: Error Image::Compare (jpg files)
body: <p>I'm trying to use <a href="http://metacpan.org/pod/Image::Compare" rel="nofollow"><code>Image::Compare</code></a> in perl to compare two images based on the colors used in the images. Here is the code i'm using:</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  use Image::Compare;
  my ($cmp) = Image::Compare-&gt;new();
  $cmp-&gt;set_image1(
      img  =&gt; "$ARGV[0]",
      type =&gt; 'jpg',
  );
  $cmp-&gt;set_image2(
      img  =&gt; "$ARGV[1]",
      type =&gt; 'jpg',
  );
  $cmp-&gt;set_method(
      method =&gt; &amp;Image::Compare::THRESHOLD,
      args   =&gt; 70,
  );
  
  if ( $cmp-&gt;compare() ) {
      print "same \n";
  } else {
      print "not same\n";
  }
  </code></pre>
  
  <p>When run it, it gave the error:</p>
  
  <blockquote>
    <p><code>Unable to read image data from file 'test_002.jpg': 'format 'jpg' not
    supported - formats bmp, ico, pnm, raw, sgi, tga available for reading
    - Can't locate Imager/File/JPG.pm or Imager/File/JPGReader.pm' at /usr/local/share/perl/5.18.2/Image/Compare.pm line 162.</code></p>
  </blockquote>
  
  <p>I've tried to install <code>Imager::File::JPEG</code>, but also gave me errors:</p>
  
  <blockquote>
    <p><code>$ cpan install Imager::File::JPEG Reading '/home/b0y/.cpan/Metadata'<br>
    Database was generated on Sat, 18 Oct 2014 07:05:12 GMT Running
    install for module 'Imager::File::JPEG' Running make for
    T/TO/TONYC/Imager-File-JPEG-0.88.tar.gz Checksum for
    /home/b0y/.cpan/sources/authors/id/T/TO/TONYC/Imager-File-JPEG-0.88.tar.gz
    ok</code></p>
    
    <p><code>CPAN.pm: Building T/TO/TONYC/Imager-File-JPEG-0.88.tar.gz</code></p>
    
    <p><code>JPEG: building independently JPEG: main: includes not found -
    libraries found JPEG: Checking if the compiler can find them on its
    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]<br>
    TONYC/Imager-File-JPEG-0.88.tar.gz   /usr/bin/perl Makefile.PL
    INSTALLDIRS=site -- NOT OK Running make test   Make had some problems,
    won't test Running make install   Make had some problems, won't
    install Could not read metadata file. Falling back to other methods to
    determine prerequisites</code></p>
  </blockquote>
  
  <p>Many thanks.</p>