Batch-converting images for an HDTV

A couple of days ago, my parents bought their first HDTV. Since it has a USB port that can be used to show pictures stored on a flash drive, I found myself in the position of finally using an old 512 MB stick I had lying around.

I scouted my iPhoto Libraries for pictures, and simply dragged them into a folder I had created. I quickly stumbled across two problems:

  1. The Finder almost immediately reported that the drive was full, even when it still had over 350 MB available, or that one or more files couldn’t “be read or written”;
  2. 8-megapixel images are just too big for a Full HD screen, so you end up wasting a lot of space and possibly slowing down the TV.

Did I fix them? You bet I did. Read on to find how.

Continue reading “Batch-converting images for an HDTV”

Installing the MySQLdb Python module on Snow Leopard

Needing to access a MySQL database through Python, I was faced by the inability to easily install the MySQLdb module. I do use MacPorts, but after running the obvious
sudo port install py26-mysql
I realized that I would be downloading, compiling and installing a new instance of Python, a new instance of MySQL (I prefer the simplicity of MAMP), and who knows what else.

Installing the module alone doesn’t work, because MAMP installs no headers; and copying the headers from the vanilla MySQL distribution doesn’t help either, because a few of the required files are generated on the fly during the installation of MySQL itself.

The solution, it turns out, is relatively simple. Follow along. Continue reading “Installing the MySQLdb Python module on Snow Leopard”