Books, movies, politics, and whatever I want

Archive for the ‘Photography’ Category

Sorting pictures

Monday, December 21st, 2015

I’ve been backing up my iPhone photos to my Windows 10 desktop using Microsoft’s OneDrive.  The photos are on my local drive as well as the cloud.  The downside is that all the photos, movies, and screen shots are dumped into a single directory, and there are a lot of them.

I prefer to have them sorted by date into directories.  A directory for each year, with sub-directories for each month.  I could do this by hand, but that’s a pain, and I have to remember to do it on a regular basis.  Plus I’ll probably want to do the same for my wife’s iPhone photos.  So I decided to write a python script to scan the camera roll directory, and copy the files to a directory in my photo archive section.  The scrip will create directories if needed and skip files that are already in place.

That part was pretty straight forward. I used os.chdir() to get to source directory and os.listdir() to get the directory contents.  Don’t want to create month directories for directories, just files, so I used os.path.isfile() to filter out non-files, and then check the file extension.  I only want jpg, mov, png, and tiff files.  I use Camera+ most of the time, which produces tiff files instead of jpg files. The png files are screenshots.

I used os.stat() to get the create time, and found files I exported to the camera roll from Camera plus had a create time of when they were exported, not the time the photo was taken. (Once I started having Camera+ dump straight to the camera roll, I didn’t have this problem).

So, I dug a little deeper and found I could get an image created time stamp with a getImageDate() call.  Downside was this didn’t work for png, tiff, or mov files.   So I had to do some extra sorting, and wrote another function to use on just the jpg files. I called the open() function from the Image library, and extracted the exif data using the _getexif() function. This works most of the time, so when it fails I had it return a ‘?’ rather than the time stamp string.  Seeing that caused a fall back to the getImageDate() function.

This extra call to the Image library made the placement of the files more accurate.  I had the base time function return the month as a three character string and the year as a 4 characters string.  This required some basic string manipulation. Those two parameters were added to predetermined destination and passed to a function I had written for another project that checks if directory exits, and creates it if it does not.

Next was to have the program check to see if the file already existed in the correct destination directory.  If it did, don’t bother copying it again. This will make the incremental runs faster and save on unneeded file transfers.

Now I have a functional script that I can set up to automatically run once a week.  Once the files are archived off OneDrive, I can removed them there and on the iPhone is order to free up space.

Originally posted to Urbin Technology.  I put the source code for the time stamp functions there.

Tags: , ,

Cat in a Box

Tuesday, July 3rd, 2012

I’m pretty sure Amazon doesn’t deliver kittens, yet…

Tags: , , , ,

Saint Bernard Keg

Wednesday, June 13th, 2012

One of my sons got a Saint Bernard, so I had to get a keg for the beast.

The son in question is a Helicopter pilot, the sticker was his idea.

Originally posted at the Slices of Life blog

Tags: , , , , ,

Sunday SciFi: Star Trek Weapons

Sunday, August 14th, 2011

 
 Yes, I own both of those.  No problem with Geek Cred here.

This is the same image I have loaded on flicker, just punched it up a bit.

Tags: , , , , , ,

Statue of George Washington

Monday, July 4th, 2011

A statue of George Washington in the National Museum of American History. Done in the classic Greek style, it’s tending toward the ‘deification’ that Washington was never comfortable with.

Originally posted at Slices of Life blog.

Tags: , , , , , ,

The light blogging lately

Wednesday, April 28th, 2010

It’s been kinda content light here the past couple of weeks, but things have been a bit busy.

For one of those reasons, I’d like to give a shout out to the really top notch team as the Foster Hospital for Small Animals, which is part of the Tufts Cummings School of Veterinary Medicine.

They did some really amazing work with one of my Golden Retrievers.

Speaking of small animals, the cat is actually in the bag…

Tags: , ,

Film Camera spotted in the Wild

Thursday, April 22nd, 2010

An actual Film Camera spotted in the wild! The person with the camera was taking a photography class, and some of her assignments required an actual film camera to be used.

Originally posted at Slices of Life

Tags: , ,

Stone Lion in the Snow

Monday, January 11th, 2010

One of the stone lions outside the Sigma Alpha Epsilon headquarters in Evanston, IL.

Originally published at Slices of Life Photography Blog.

Tags: , , , , ,

Worcester Tea Party Pictures

Tuesday, September 8th, 2009

There was a small Tea Party Protest at Lincoln Square in Worcester, MA on September 3, 2009.

This was a warm up for three bus loads of Patriots from the Commonwealth going to Washington, D.C. this week for the 9/12 protests.

I have pictures posted at Urbin Photography & at my account on flickr.

I’m also trying to get them posted at PJTV.

Here is one of the videos I took at this protest.

There was a larger Tea Party Protest in Worcester, MA back on Tax Day.

Tags: , , , ,

Tired Boots

Sunday, August 9th, 2009
Tired U.S. Army Boots

Tired U.S. Army Boots

A pair of U.S. Army boots.

Tags: , , ,