Sunday, August 29, 2010

Post-Trip Photo Post-Processing

After returning from vacation, I wanted to develop a flow for post-processing my photos. It didn't go very well, but this ugly process got me there.

1. Tweak photos and add captions in Picasa
This includes minor color and contrast adjustments, cropping, and adding captions. Nothing too tricky here.

2. Add Borders and Copyright information in Gimp
This is where it got tricky. I modified the batch processing plug-in for Gimp called PhotoLab to add a border that I liked better than the original. I also added copyright information that is written on the border. The biggest hurdle though was Gimp itself -- the built-in jpg save functions lose all the metadata, including the photo-taken timestamp that I use to sort the photos and the captions that I added in Picasa.
To rectify this problem, I called the executable version of exiftools from within the python script. A better way would have been to code it directly into the plug-in, but I ran out of patience for that. Hopefully the upcoming Gimp version 2.8 will fix this problem.

It is not particularly robust, but these items are essential:
The script can be found here:  http://registry.gimp.org/node/24708

3. Rename the Photos, in almost chronological order.
I wanted to rename my photos in the order that I wanted them to appear in the album. This is almost chronological order, but I added a cover image and map (the original motivation came from having images from two cameras that had unique numbering schemes. There are probably a dozen better ways to do this, but I was burnt-out on this project by now. I did this by
  1. Copying the two images I wanted first to a directory named "renamed_images" and manually editing their names.
  2. Ran the following exiftools command: exiftool -fileOrder CreateDate -filename=Norway_Aug2010%-c.jpg -directory=renamed_images/%d .
The command moves the files, adding a copy number to the end.

4. Credits
1.  The "base" of the script was batch processing for adding borders and title information from the PhotoLab suite of Gimp tools.  http://registry.gimp.org/node/157

List of changes:
  • Changed the "title" feature to be a copyright feature
  • Placed the copyright information on the border (size scales with border so it always fits).
  • Replaced the border with one I liked better (see #2 below)
  • Used exiftool to preserve metadata (see #3 below)
  • Note:  I have not renamed the script from the PhotoLab original.
  • Note:  The script is now limited to JPG images (mostly to preserve metadata)

2.  I replaced the border with a modified version of the border implemented in the two_color_borders.py script.  http://registry.gimp.org/node/24635
  • Changed the script so that the border overlays the edges of the current image in order to maintain the original aspect ratio.  A quick code change can switch it back (I meant to make this an option, but ran out of time).
3.  In order to "preserve" metadata, I used ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/) to copy the metadata from the original JPG to the new JPG.
  • Note:  ExifTool.exe must reside on your path.






Sunday, April 4, 2010

Removing Duplicate Files

Want to save some disk space? How about removing all duplicate copies of your files? Fortunately, there are free tools to help you do this. I used DoubleKiller after reading the LifeHacker post: http://lifehacker.com/330037/top-10-free-windows-file-wranglers.
  • Found many data files that were duplicates
  • Found many copies of VIRSCAN*.dat files from Symantec AntiVirus. Deleted all the ones in *.tmp folders (actually, moved them to a holding location). No issues so far.
  • If you have multiple copies of Matlab installed, I would recommend removing those from the search path

Check out WinDirStat from the that LifeHacker post too.

Modifying the Windows-E Shortcut Key's Behavior

Background: Pressing the key combination [Windows Logo Key] + [e] opens Windows Explorer.
I use this short-cut all the time, but I was annoyed that it always opened with the C:\ fully expanded, which took-up most of the viewable space in the left-hand pane of Windows Explorer.
After a bit of web-searching and playing around, I found a solution.
  1. Go to: Start Menu -> Run -> regedit
  2. Locate the registry key: HKEY_CLASSES_ROOT\Folder\shell\explore\ddeexec
  3. The (Default) value should be something like: %SystemRoot%\Explorer.exe /e,/idlist,%I,%L

  4. Delete this value so that the entry is blank (right-click on (Default), choose "Modify")


[EDIT] Recently noted my personal computer has "My Documents" appearing ahead of C:\. I need to find out how to get that for my work computer.

Thursday, November 13, 2008

Upgrading the HP ze4600 to Ubuntu 8.10

I got my hands on the HP ze4600 again and off I went to upgrade the Ubuntu installation to 8.10.

I have a friend who says he never bothers with the upgrade - he always just does a fresh install. I see his point, but I always hold out hope that the upgrade will be quicker and less painful. So now for my experience on the HP laptop.

Ran the upgrade and all went pretty smoothly. It wanted to overwrite my /boot/grub/menu.lst file, which I had modified to make Windows XP the first and default choice. I first tried to use the merge tool, but I couldn't figure it out. So I let the install overwrite it. Of course when the computer rebooted at the end of the install, windows was no longer a choice. No problem - the old menu.lst file was saved with an obvious filename, copied the Windows XP lines back into the current file, and problem solved.

The unexpected happy news...WiFi suddenly started to work!! I had never been able to get it to recognize the Broadcom 4306 rev 2 chip. Now it immediately recognized the proprietary hardware with the b43 module (or something like that - will grab a screenshot next time I'm allowed on the computer).

Thursday, November 6, 2008

An upgrade to Xubuntu 8.10

I resisted for a few weeks, but I couldn't hold out any longer. Despite having no complaints with Xubuntu 8.04 on my old Dell Latitude L400, I had to upgrade to 8.10.

The upgrade went smoothly. I was happy to see that my install and setup of wicd and all my Firefox add-ons carried over. The problem with the laptop going to sleep mode 5 seconds are starting up returned, but I expected that since I allowed the upgrade to overwrite the changes I had made to my /etc/default/acpi-support file described in my previous post.

1. The First Step Towards Resolving the Sleep Problem
I have suspected that the problem stems from running the laptop without a battery installed (mine is in such bad shape, the computer complains if I put it in). I decided to test this theory indirectly, so I booted with the kernel options "noapm noacpi acpi=off apm=off". Once booted I went to Applications->Settings->Power Management. I think there was a tab there called "On Battery Power" where I chose "Do Nothing" when battery power is low. I intended to post a screen shot, but that tab has diasppeared (why??).



The results:
  • The laptop tries to go to sleep once during boot, but once awoken, it usually finishes booting with no further problems. I've noticed that it does a battery check during startup, so I'll try to disable that and see if it fixes the problem.
  • The whole system has a bit of flakiness. Sometimes my WiFi card doesn't get power during boot-up, sometimes it does. Sliding it out of the pc card slot and back in usually does the trick. Sometimes it doesn't finish shutdown, and sometimes the hard disk doesn't come alive at all on boot (I think when I do a restart rather than a full shutdown). I'll keep looking into these issues.
2. The Second Step Towards Resolving the Sleep Problem
I went to Applications->System->Services and disabled acpid and apmd (and bluetooth too since this machine doesn't have it).

The results:
  1. Smooth boot from cold start - hooray!
  2. Standby mode works. Maybe it did before too, never tested it.
  3. The "restart" option doesn't work. The computer restarts, but the hard disk appears to never come alive. Not a significant problem really, just a little annoying.
Next Steps
1. Try disabling acpid and apmd independently
2. Install in "desktop" mode rather than "laptop" mode so there is no expectation of a battery?
3. Search on why my hard disk might not comeback after a "restart".

Thursday, October 23, 2008

Notes on Linux Installs

Lately I've been installing some flavor of linux, usually one of the ubuntu distros, on nearly every thing I can get my hands on. I've created this page of notes to remind me of the problems and solutions I've encountered.

1. Mythbuntu 8.04 on an Intel P4 3GHz

I bought a SiliconDust HDHomeRun and wanted to run mythTV on a spare PC already connected to my 1080P DLP HDTV. I burned mythbuntu 8.04 to a Live CD and followed the directions here: https://help.ubuntu.com/community/HDHomeRun. All went smoothly; my version of mythbuntu seemed a bit different (newer?), but everything was still pretty obvious. All was well until I started trying to watch TV...

I have an ATI Radeon 9600 video card. I've read all over the web that this card can't be used with HDTV in Linux. THIS IS NOT TRUE. I currently have it working, through no skill of my own besides websurfing. Using the standard ubuntu procedure, I enabled the proprietary ATI Linux drivers (solved a flickering screen issue I had just after the install). At this point, I couldn't watch any of the MPEG2 streams recorded from the HDHomerun, but I knew they were recorded because the little preview would play fine.

After reading many pages, I found this one. Buried in the webpage, is this section:

Post-Installation Tweaks

To enable hardware accelerated video on pre-R500 cards, edit /etc/X11/xorg.conf to include the following lines without [...]
File: /etc/X11/xorg.conf
Section "Device"
[...]
Driver "fglrx"
Option "VideoOverlay" "on"
Option "OpenGLOverlay" "off"
[...]
EndSection

Made this change and 1080i works beautifully.

2. Ubuntu 8.04 on a Hewlett-Packard ze4600 (AMD)
My girlfriend's laptop. It had been running WindowsXP and became unbearably slow. We decided to format and reinstall XP, and I took the opportunity to also add Ubuntu. Ran into several issues.

  • The install would give me a strange error that looked like a hard disk problem (should have saved it), but I realized it was the CD drive it was complaining about. The confusing thing was that it would start at random places during the install. After a bit of searching on the error, I found some advice to try burning the Live/Install CD at a slower speed. That did the trick.
  • We had installed windows XP first allowing it to use the full disk. Based on prior experience, I expected Ubuntu to automatically resize the windows partition and install on a new partition. But it wouldn't give me the resize option. Solution: booted the LiveCD and tried repartitioning the drive using gparted(?). It complained of bad sectors on the disk - this apparently prevents the Ubuntu from doing its magic during the install. Went command line and forced things using fdisk and ntfsresize I think. Installed Ubuntu successfully.
  • Wireless doesn't work. It's running a Broadcom 4306 rev 02. I've found instructions here, but haven't gotten it working. Will update when/if I do. (Update - after upgrading to 8.10, it recognized the card and everything started working...).
3. Xubuntu 8.04 Hardy Heron on a Dell Latitude L400
Trying to turn this one into a cheap netbook. Sort of amusing since it has zero minutes of battery life and hinges so broken I'm afraid to touch it...probably the point where I realized I have an addiction...

  • Install would randomly crash in the middle. Have no idea why, just kept trying until I got to the end. Looking back, it was probably either trouble reading the CD or something to do with the sleep mode described below.
  • My L400 would boot-up, but then mysteriously die before I had time to login. I was completely befuddled. Until I ran across this post. No idea how Gavin ever figured this all out, but I owe him a debt of gratitude. For my setup, all I had to do was:
    • in /etc/default/acpi-support, 
    • set ACPI_SLEEP=false
      
  • Wireless didn't work...it's a Broadcom 4306 rev 03. Somehow got this one working after a few missteps. Mostly followed the instructions here. Somewhere along the way, I disabled "Roaming Mode" for the wireless, which was apparently the wrong thing to do.
  • Having to enter the keyring for the wireless key at every login was annoying. Found a solution without autologin, but I'm lazy and I like autologin. Best solution I've found with autologin is to replace the built-in wireless manager with wicd.