Archive for the 'Mac' Category

Mac OS X: decoder jpeg not available

If you are using PIL(Python Imaging Library) on Mac OS X(Tiger), you will probably have a “decoder jpeg not available” when resizing a jpeg image.
This probably means that PIL doesn’t have JPEG support, because libjpeg wasn’t found when PIL was being configured.
Here is the solution:

  • Download, compile and install jpeglib and zlib
  • Edit PIL setup.py and change to:

    JPEG_ROOT = "/usr/local/include"
    ZLIB_ROOT = "/usr/local/include"
    
  • Compile:

    python setup.py build_ext -i
    
  • Test:

    python selftest.py
    
  • If the result is something like this:

    "57 tests passed."
    
  • You are ready to go:

    python setup.py install
    

Terminal colors on Mac

Trivial but useful.
If you are using bash, just edit your .profile (explanation):

# colors
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=gxgxcxdxbxegedabagacad  # cyan directories
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '

iMic for my Mac mini

iMic

I think that is very weird that Mac mini doesn’t have a mic or a simple line-in interface, i had to wait for 15 days and pay for the iMic 53 €.
For those who doesn’t know what it is:

The iMic universal audio adapter is a USB device that adds stereo input and output to your Mac or PC. Connect virtually any microphone or sound input device to your iBook, PowerBook, PowerMac or other Mac or PC with a USB port. Yes, iMic supports both Mic level and line level input. It also supports line level output for connecting speakers or an external recording device.