Wear sunscreen..

One of the instructors at the spin classes at the gym likes to play this song/advice by Baz Luhrmann at the end of sessions, so its now wedged in my brain.

It seems like pretty good advice though!

Converting Lightroom GPS coordinates for Google Maps

I have wanted to add a map of the locations of the photographs on my photo blog SeeStockholm.se for a while now.  I have the coordinates in Lightroom for the images in the degrees, minutes, seconds (DMS) format e.g. 59°16’31″ N 18°19’8″. However Google Maps uses the decimal degrees (DD) format e.g. 59.2753 N 18.3189 E.  

I needed a way to convert the coordinates from one representation to the other. After a bit of googling and some experiementation I wrote the following Javascript functions to convert from DMS format to DD format and create a google maps google.maps.LatLng object.

    function ConvertDMSToDD(days, minutes, seconds, direction) 
    {
        var dd = parseFloat(days) + parseFloat(minutes/60) + parseFloat(seconds/(60*60));
        if (direction == "S" || direction == "W") {
            dd = dd * -1;
        } // Don't do anything for N or E
        return dd;
    }

    function ParseDMS(input) 
    {
        var parts = input.split(/[^\d\w]+/);
        var lat = ConvertDMSToDD(parts[0], parts[1], parts[2], parts[3]);
        var lng = ConvertDMSToDD(parts[4], parts[5], parts[6], parts[7]);
        return new google.maps.LatLng( lat, lng );
    }

This makes the conversion process simply a case of calling ParseDMS with a DMS format coordinate in string form and it will return a LatLng object ready for use in Google Maps. These conversion functions allowed me to easily implement the map feature for my photo blog.

Moving WordPress between Domains

I recently moved my photo blog to a new domain and this is how I got all the wordpress data and files transfered and setup.  This guide is based off the official Moving WordPress guide on the WordPress Codex with the extra steps I need as I was moving an existing site to a new site that was created using my ISP one click installer.

  1. Backup the original site:
    1. Use an FTP client to download copies of all the file from your old wordpress installation and also any files in your file upload location if you are using a custom location (you can check this in Settings > Media).
    2. Use phpMyAdmin to download a copy of the database.
    3. Store these copies in a folder clearly named something like ‘original files’.
  2. Change Domain:
    1. Log into your blog’s administrator account.
    2. Go to the administration > Settings > General panel.
    3. Change the WordPress address (URI) and Site Address (URL) box to the new URL which should match.
    4. Click save changes but do not try to view your blog now!
    5. Using an FTP client download copies of all the file from your old wordpress installation and also any files in your file upload location if you are using a custom location (you can check this in Settings > Media).
    6. Use phpMyAdmin to download a copy of the database.
    7. Store these new files in another folder named something like ‘modified files’.
  3. Restore your old site back to its original state by uploading the original files using an FTP client and restoring the original database using phpMyAdmin.  It should be safe to goto the site again and it should work.
  4. Download the wp-config.php file created by your ISP’s one click installer this has the configuration details we need to run the old site on the new installation.
  5. Copy the key database settings from the new configuration file into the configuration file in the modified files directory, this will allow the old site to run in the new installation.  I copied the following settings from the new file into the modified file:
    1. DB_NAME
    2. DB_USER
    3. DB_PASSWORD
    4. DB_HOST
    5. DB_CHARSET
    6. DB_COLLATE
  6. Drop the wordpress tables in the new database created by your ISP’s installer, they will be prefixed by whatever table_prefix is set to in the new config file.
  7. Rename the tables in the database backup, search for table_prefix from the old configuration file and replace it with the prefix specified in the new configuration file.  This isn’t essential but I like things to be tidy.
  8. Upload the modified files using an FTP client to the new server and the tables in the modified database using phpMyAdmin to the empty new database.
  9. Replace the links to the old site in the posts table in phpMyAdmin using the replace function in a MySQL query, you only need to search the post_content field: replace the old URL with the new URL.

Your old site should now be running on the new domain with working links and correctly named database tables.  This guide is meant as a rough guide for those wishing to move a domain without relying on automated scripts and is a record of how I moved my WordPress 3.5 site between domains.

Follow this guide at your own risk!

Kindle Paperwhite

Amazon have just released the Kindle I have been waiting for: one with a backlight integrated into the unit, touchscreen and smart cover!  The new model is called the Paperwhite and its features include:

  • Evenly backlight display.
  • Touch screen with multi-touch.
  • 62% more pixels for sharper text.
  • 25% more contrast.
  • More hand tuned fonts.
  • Excellant battery life.
  • Smart cover with auto wake/sleep.

I was particularly excited by this new model as I have a trip to Antarctica at the end of the month that will involve an epic amount of flights!  So I had a friend bring me one back from the states as the Paperwhite is not yet available in Sweden.

The new Amazon Kindle PaperwhiteThe screen is amazing the combination of even backlighting, more resolution and increased contrast really improves the reading experience and make the device easy to read in all lighting conditions I have encountered so far.

Going from the older third generation Kindle with Keyboard to the Paperwhite has been a bit of a revolution as the touch screen interface feels significantly more responsive than the old physical keyboard.  The device itself is smaller and more streamlined with the removal of the headphone jack and volume bottoms which I never used.

The smart cover is a case that complete enclosed the device when closed leaving only the power botton and charging socket exposed.  The cover has a magnet in it just like the iPad smart cover so opening the cover will wake up the device and closing puts the device to sleep which is a nice touch.

The only gripe I have is there is no way to see the books cover art without losing the bottom third of the screen to Amazon’s shop highlights which is annoying as I paid extra for the advertising free model.

This Kindle is a real upgrade compared to the previous generations: highly recommended!

Ditching the iPad

I finally bought an iPad in April after wanting one for quite some time for showing my photographs on but six months later I find myself thinking about selling my iPad2.  So what happened?

Its another device to manage, I only have a single computer at home as I can’t be bothered to keep multiple computers configured, synced and updated.  Same thing turns out to be true with mobile devices, I simply can’t be bothered to manage an iPad and an iPhone!

The size of the iPad even in a slim case is about the same size as my Laptop without a case, while this is small for a computers its big for a mobile device.  Especially when I have an iPhone that almost always carry that can run 99% of the same apps but is a fraction of the size..

One of my original main reasons for wanting an iPad was for showing my photographs on it and it is fantastic for this but I find that as I’m not carrying it with me its not really getting used much for sharing as I am making do with the iPhone.

While I will miss the big screen browsing experience on the iPad and the iPad optimised versions of the apps I frequently use.  I have found that as I am not taking the iPad with me much any more and its been relegated to weekend couch browsing duties which my laptop can do better.

Maybe a Kindle sized iPad would be the sweet spot for me size wise..

Backing up Lightroom to Dropbox

I use Dropbox as an offsite backup to complement my Time Machine backups that I have on a pair of external hard drives, however backing up my entire Lightroom catalogue contents to dropbox is impractical due to its sheer size.  So after a bit of searching I figured out how to backup only the good pictures in a structured folder hierarchy of Year/Month/Day in JPEG format to dropbox:

  1. Install the DateExport Lightroom plugin, you can find it here on GitHub.
  2. Filter the photographs you want to backup in Lightroom.  I use the star rating system built into Lightroom so its as easy as selecting the entire catalogue and filtering out all un-starred images.
  3. Export the photographs you’ve just filtered using the DateExport plugin, I have highlighted the two important options in the export dialogue.
    DateExport Dialogue
    The First important option is to use the DateExport plugin for the export and the second controls how the files are exported in this case into a folder hierarchy of Year/Month/Day into my Dropbox.

Backup up Lightroom in a structured manner like this becomes very simple with the DateExport plugin, so I’d recommend using it.  You can export using all the normal options with this plguing e.g. DNG, RAW, sharpening etc but for me right now having an extra backup of the JPEG files is enough as I have a double backup of the RAW files else where.