Skip to content

exiftool can fix your Aperture library

After waiting for the barrier to entry to become feasible for my pocketbook, I finally jumped into the DSLR world by purchasing a new Nikon D5100. Thus far it has been an absolutely wonderful camera and has provided me many photos that I will cherish for many years to come. My first one thousand exposures or so were taken with an incorrect date programmed into my camera. Every bit of date related metadata in my images is off by exactly one year. Looks like I forgot it was 2011 and put 2010 into the settings. I use Aperture to process, organize and edit my photos, but I could find no way to increase the year by one on all of my images.

Enter ExifTool. The amazing perl script that will read and save metadata to almost every digital photo file format known to man.

ExifTool makes it easy to increase the year by one, with this simple command that can be run on an entire Directory, or individual file:

exiftool -AllDates+="1:0:0 00:00:00" DIR (or filename)

Now, I peeked inside my Aperture Library and found the directory called “Masters”, where all Master image files are stored. I ran the following script inside the directory and it took care of business. My semi complicated find command ignores files with spaces, ignores Canon, iPhone and other unwanted files. What I’m left with is my Nikon pictures, which I can then run the exiftool command on.

#!/bin/bash
 
function is2010() {
	fileName=$1
	creationYear=$(exiftool $fileName | grep "Date/Time" | sed 's/^.*: //g' | awk -F":" '{print $1}' | grep 2010)
	return $?
}
 
imageFiles=$(find . -type f ! -name "*(*" ! -name '* *' \( -iname "*.jpg" -or -iname "*.nef" \) ! -iname ".*" ! -iname "IMG_*" ! -name "CSC_*")
 
for f in $(echo $imageFiles)
do
	if ( `is2010 $f` ); then
		exiftool -AllDates+="1:0:0 00:00:00" $f
	else
		echo "skipping $f"
	fi
done

Categories: Uncategorized.

Floors almost done! Next up, a darker finish…

Categories: Uncategorized.

systems engineering can be dangerous

While talking about how excited I am for tonight’s national championship game, I spilled boiling hot green tea all over my foot. It went through my socks and down into my shoe where it continued to sit and further burn my skin. It hurts bad. If the Ducks lose tonight, the pain from my foot should override the devastation from a BCS loss.

UPDATE: If you want to see some seriously gross foot burn action follow this link. I’m warning you, it is quite disgusting. I guess burns get worse after a couple of days.

Categories: Uncategorized.

Camera phone provides window into brain

The subject matter of the average iPhone photo is so comically different from what you see come out of traditional single-use cameras. By all known and accepted photography standards, my phone snapshots are horrible. They are out of focus, framed poorly, the lighting usually sucks, but they have a certain quantity of “realness” thanks to the impulsivity that usually plays a role in their capture.

Categories: Uncategorized.

global iphone pics

An almost complete trail of where I’ve been over the last couple of years. Missing ATL, LAX and DENVER, but close enough!

Categories: Uncategorized.

I spent some time in the garage this weekend

I love my garage. It is, with out a doubt, my favorite room in the house. Here are some photos of my latest efforts to organize my server infrastructure. At the bottom of the gallery you’ll find a little video tour I shot with my iPhone. If you’re curious, I’ve got an AppleTV running Ubuntu 8.04, a Dell D520 Laptop running Ubuntu 10.04 LTS and a Dell XPS 720 with Ubuntu-Server 10.04 installed.

Categories: Uncategorized.

I wrote this to learn iOS development

QuickFactor is an application I originally wrote to find factors for a given number. What I didn’t realize is that there is an application already in the App store that gives factors for a number as well as GCF, LCM and prime factors. I felt it was necessary to at least offer the same feature set so I went ahead and added those things to the existing design. When I had just one input and one task to worry about, it was pretty simple to have a bar across the top of the window, similar to what you’d see in Safari. It’s a familiar layout to most and the feel of the application doing work while input is being inserted encourages efficiency. This application is not a feat of engineering by any means, but I did learn plenty about what it takes to get an app into the App store
QuickFactor

Categories: Uncategorized.

Tags:

Tunes to do work

Straight Lines by Silverchair
Cult Logic by Miike Snow
I’ll Get You (feat. Jeppe) by Classixx
Satellite by Guster
Jesus Christ by Brand New
Stop Me by Mark Ronson featuring Daniel Merriweather
Moar Ghosts ‘n’ Stuff by Deadmau5
Natural Disaster by Fischerspooner
So Easy by Royksopp
Making Me Nervous by Brad Sucks
Du What U Du (Trentemoller Mix) by Yoshimoto
Tribulations by LCD Soundsystem
Bonafied Lovin’ (Yuksek Remix) by Chromeo
Language Symbolique by Thievery Corporation
One Minute to Midnight by Justice
Love Is Gonna Save Us by Benny Benassi Presents The Biz
Elephant (Dub Mix) by Spiral System & Lottie Child
Supreme Illusion (Nickodemus Remix) by Thievery Corporation
Sad Sad City by Ghostland Observatory
The Geeks Were Right by The Faint

Categories: Uncategorized.

Tags:

Control Characters in UITextField

If you find yourself needing to limit the types and the length of input in a UITextField object, the below “tutorial” should suffice. Make sure you configure your nib (.xib) file to delegate control to your class (usually your view controller class).

Complete the setup of your class to be a delegate for UITextField by adding “UITextFieldDelegate” to your list of Delegates in your header file.

ViewController.h

?View Code OBJECTIVE-C
@interface QuickFactorViewController : UIViewController <UITextFieldDelegate> {
	IBOutlet UITextField *inputParameter;
}
 
@property (nonatomic, retain) IBOutlet UITextField *inputParameter;
 
@end

For my code, I used some constants which are defined at the top of your class implementation file (*.m file).
ViewController.m

?View Code OBJECTIVE-C
#define LEGAL	@"0123456789"
#define MAX_LENGTH 9

Then you need to implement the “shouldChangeCharactersInRange” method as stated by the UITextFieldDelegate protocol. This example will filter the input so that only numbers are allowed. It will also only allow up to 9 digits to be entered.
ViewController.m

?View Code OBJECTIVE-C
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
	if (textField.text.length >= MAX_LENGTH && range.length == 0)    {
        return NO; 
    }
 
    NSCharacterSet *cs = [[NSCharacterSet characterSetWithCharactersInString:LEGAL] invertedSet];
    NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs] componentsJoinedByString:@""];
    return [string isEqualToString:filtered];
}

Categories: Uncategorized.