title: PIL zip jpeg decoders not working on runtime but work on install/selftest
body: <p>I'm running Debian 6 and recently installed PIL.</p>
  
  <p>I have preinstalled the zlib and jpeg libraries, and they're both on /usr/lib </p>
  
  <p>When installing, the setup.py file finds the libraries, I get the standard:</p>
  
  <pre><code>--------------------------------------------------------------------
  PIL 1.1.7 SETUP SUMMARY
  --------------------------------------------------------------------
  version       1.1.7
  platform      linux2 2.7.3 (default, Jun 29 2012, 22:38:23)
                [GCC 4.4.5]
  --------------------------------------------------------------------
  *** TKINTER support not available
  --- JPEG support available
  --- ZLIB (PNG/ZIP) support available
  --- FREETYPE2 support available
  --- LITTLECMS support available
  </code></pre>
  
  <p>zlib and jpeg are working as expected. Running selftest.py also succeeds</p>
  
  <pre><code>--------------------------------------------------------------------
  PIL 1.1.7 TEST SUMMARY
  --------------------------------------------------------------------
  Python modules loaded from ./PIL
  Binary modules loaded from ./PIL
  --------------------------------------------------------------------
  --- PIL CORE support ok
  *** TKINTER support not installed
  --- JPEG support ok
  --- ZLIB (PNG/ZIP) support ok
  --- FREETYPE2 support ok
  --- LITTLECMS support ok
  --------------------------------------------------------------------
  Running selftest:
  --- 57 tests passed.
  </code></pre>
  
  <p>So we're rejoicing so far.</p>
  
  <p>Just to make sure, we run python and test that zlib decoder works</p>
  
  <pre><code>Python 2.7.3 (default, Jun 29 2012, 22:38:23)
  [GCC 4.4.5] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import zlib
  &gt;&gt;&gt; a=zlib.compress('hello world')
  &gt;&gt;&gt; print zlib.decompress(a)
  hello world
  </code></pre>
  
  <p>So, it works.</p>
  
  <p>However, when I try to save an Image:</p>
  
  <pre><code>&gt;&gt;&gt; import Image
  &gt;&gt;&gt; i = Image.open('a.png')
  &gt;&gt;&gt; i.save('b.png')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1406, in save
      self.load()
    File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 189, in load
      d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
    File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 385, in _getdecoder
      raise IOError("decoder %s not available" % decoder_name)
  IOError: decoder zip not available
  </code></pre>
  
  <p>Same error if I try to save as jpeg (except the jpeg decoder is the unavailable one)</p>
  
  <p>If I check Image.core, I see that, in fact, there's no zip_decoder nor jpeg_decoder attributes.</p>
  
  <pre><code>&gt;&gt;&gt; dir(Image.core)
  ['__doc__', '__file__', '__name__', '__package__', 'bit_decoder', 'blend', 'convert',
  'copy', 'crc32', 'draw', 'effect_mandelbrot', 'effect_noise', 'eps_encoder', 'fill', 
  'fli_decoder', 'font', 'getcodecstatus', 'getcount', 'gif_decoder', 'gif_encoder',
  'hex_decoder', 'hex_encoder', 'linear_gradient', 'map_buffer', 'msp_decoder', 'new', 
  'open_ppm', 'outline', 'packbits_decoder', 'path', 'pcd_decoder', 'pcx_decoder', 
  'pcx_encoder', 'radial_gradient', 'raw_decoder', 'raw_encoder', 'sun_rle_decoder', 
  'tga_rle_decoder', 'tiff_lzw_decoder', 'wedge', 'xbm_decoder', 'xbm_encoder']
  </code></pre>
  
  <p>I can't find out what it is, as I see it, even though it FINDS the proper libraries on installation (so it's not a problem of the setup not finding the library, it finds them), the core object is created without the proper decoders.</p>
  
  <p>Have tried reinstalling PIL lots of times, checking the permissions on the /usr/lib directories and .so files. Running PIL as root to see if there's any kind of problem. But still there's no answer.</p>
  
  <p>If anyone could help with this, it'd be great!</p>
  
  <p>Thanks in advance.</p>
  
  <p>Bruno</p>