GPixPod code explanation

Developers are welcome to reimplement in their own projects every piece of code of GPixPod. GPixPod is completely free software, released under the terms of the GNU GPL license second version (or at your option) any later one. Code of particular interest for iPod photos management includes the Photo Database file format access module mh.py and image conversions functions of the file imgconvs.py.

Details about these 2 python files follow:

mh.py

The Photo Database file found in the Photos directory on photo-capable recent iPod models (iPod Photo, iPod Color, iPod Nano, iPod video 5G) is a binary-closed format file reverse-engineered by many people in free software community: the main share point of the details discovered about the Photo Database file but also about all the other file formats (such as iTunesDB) found on Apple iPods is on the iPodLinux wiki at the address http://www.ipodlinux.org/iTunesDB.

The file has a database-like structure with parent and children records referenced between them in many ways (single and total sizes lengths, number of children); as much probably clear, there are many details to take care of when reading and writing this file: this is the job of the mh.py module. By using it, you interface with very simple commands to the Photo Database library, without ever thinking of all inner boring operations.

Continue reading these very simple API to easily modify photos and photo albums on your iPod from the command-line importing in the python (2.4+) interpreter or integrating it in your own python projects.

mh.py API

imgconvs.py

When you add a photo to the iPod (using either GPixPod or iTunes), it stores generally 4 thumbnails besides the original full resolution photo, if you choose to upload it, too. Different among all other models (iPod Photo/Color/5G video) is the iPod Nano which stores only 2 thumbnails plus the optional full resolution copy.

In every case, the full resolution copy is simply uploaded without any modification. Instead, the thumbnails are obtained by conversion to particular image formats suitable for optimized visualization on video adapters and embedded devices; IMHO, this is probably important to limit unuseful stress to iPod memory and processor components.

The thumbnails image formats are basically 2:

  • RGB 565 - like RGB, stored in 2 bytes, but byte swapped, and with fixed composited dimensions
  • Interlaced UYVY - a particular YUV 4:2:2 format, used for TV output, always 720×480

Optimized functions (toRGB565, toInterlacedUYVY, fromRGB565, fromInterlacedUYVY) using the operator module are provided to converty from any gdk-pixbuf supported format.

 
developers.txt · Last modified: 2006/04/15 12:31
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki