Scrawls from Preston...

Powered by Pelican.

Wed 29 April 2009

Reducing size of iPhoto POI database

This is probably only of interest to those of you that have to deploy iPhoto over a slower (ie wireless) network.

_updated with corrections from comments_

The main application package for iPhoto 8 is over 300mb - of that 100+ is a Points of interest database, that contains information in many languages about various points on the globe.

You can remove the non-english language stuff - and so far I have found no ill effects on an english system.

Be warned that this could brake future iPhoto updates

cd /Applications/iPhoto.app/Contents/Resources/

cp PointOfInterest.db PointOfInterest_original.db

sqlite3 PointOfInterest.db

sqlite> .read /path/to/droplanguages.sql

Where droplanguages.sql contains:

DROP TABLE GeoLookup_da;

DROP TABLE GeoLookup_de;

DROP TABLE GeoLookup_es;

DROP TABLE GeoLookup_fi;

DROP TABLE GeoLookup_fr;

DROP TABLE GeoLookup_it;

DROP TABLE GeoLookup_ja;

DROP TABLE GeoLookup_ko;

DROP TABLE GeoLookup_nl;

DROP TABLE GeoLookup_no;

DROP TABLE GeoLookup_pl;

DROP TABLE GeoLookup_pt;

DROP TABLE GeoLookup_ptbr;

DROP TABLE GeoLookup_ru;

DROP TABLE GeoLookup_sv;

DROP TABLE GeoLookup_zh;

DROP TABLE GeoLookup_zhtw;

DELETE FROM GeoPlaceNames WHERE language!="en";

VACUUM;

This reduces the POI database to a lean 12MB

To exit sqlite just type .exit on a line by itself at the sqlite3 prompt


http://ptone.com/dablog