title: python imaging library cannot save PNG to JPG
body: <p>I installed PIL 1.1.7 from source on Mac OSX.
  I also installed required libraries from Macports.
  Using python 2.6.</p>
  
  <p>After installing PIL, I could successfully run the selftest.py (all tests pass)</p>
  
  <p>But when I try running the following code, I find that I am not able to convert PNG to JPG. I am however able to convert PNG to GIF, PNG to PPM. I can also read JPGs.</p>
  
  <pre><code>import os
  import sys 
  import Image
  
  for infile in sys.argv[1:]:
      f, e = os.path.splitext(infile)
      outfile = f + ".jpg"
      print outfile
      if infile != outfile:
          try:
              Image.open(infile).save(outfile, 'jpg') #Note: gif or ppm works
          except IOError:
              print "cannot convert", infile
              if os.path.exists(outfile):
                 print 'cleaning up...'
                 os.remove(outfile)
  </code></pre>
  
  <p>** update with stack trace. Looks like encoder is missing. I did however install libjpeg thru macport.</p>
  
  <p>Cleaning up...</p>
  
  <pre><code>Traceback (most recent call last):
    File "convert_to_jpeg.py", line 15, in &lt;module&gt;
      Image.open(infile).save(outfile, 'jpeg')
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.py", line 1439, in save
      save_handler(self, fp, filename)
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/JpegImagePlugin.py", line 471, in _save
      ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/ImageFile.py", line 495, in _save
      e = Image._getencoder(im.mode, e, a, im.encoderconfig)
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.py", line 401, in _getencoder
      raise IOError("encoder %s not available" % encoder_name)
  IOError: encoder jpeg not available
  </code></pre>