Changing created/modify date of DNG files

August 16th, 2015 No comments

A “problem” I noticed when converting my RAW files to DNG is that the file creation date of the DNG files is the date the conversion was done. I would prefer if the creation date was the same date as when the photos were taken. As it turns out, you can easily change the creation date of a file by simply executing the following terminal command (Mac/Linux):

$ touch -t [YYMMDDHHMM] [filename]

This is fine except how do you know when a photo was taken? You could go to Lightroom (or some other application) to check but I prefer a command line interface. One excellent tool for this is ExifTool. This tool is so awesome that it’s even used by various commercial applications. In fact, I didn’t have to install this tool because it’s already bundled with Affinity Photo.

Once you have ExifTool, you can check the date the photo was taken by executing:

$ exiftool -createdate [filename]

Okay, now we can check the date the photo was taken and update the creation date of the file. But this isn’t easy to do manually for lots and lots of newly converted DNG files. So I’ve made a script to do it automatically for all DNG files found under a defined path:

dngfiles=$(find "$1" -name "*.dng" | sed 's/ /\\-/g' | sed 's/dng\\-/dng /g')
for entry in $dngfiles
fixentry=$(echo $entry | sed 's/\\-/ /g')
output=$(/Applications/Affinity\ -createdate "$fixentry" | grep Create | sed s/://g | sed s/\ //g | sed 's/^CreateDate//' | sed 's/..$//')
touch -t $output "$fixentry"
ls -l "$fixentry"

Let’s say we call the script To run the script, you simply give the path to check. For example:

$ ./ /Volumes/Photos/Archive/2015
Categories: Mac, Photography Tags: , ,

Deleting RAW files after converting to DNG on a Mac

August 11th, 2015 No comments

Recently, I decided to convert all my old RAW files to DNG.  This can be done from within Lightroom or with Adobe’s free DNG Converter.  In Lightroom, you have the option to have your old RAW files deleted automatically after conversion.  However, this option is unfortunately missing in the DNG Converter.

One way to do this manually is by opening a terminal session on your Mac and entering this command:

$ find [path] -name "*.[RAW extension]" -type f -delete

The above command will recursively go through all the subfolders and files under the defined path and delete all files with the defined file extension. To be safe though, you might first want to make sure that you have the same number of DNG files before deleting all the RAW files. For example:

$ find Photos/Archive/2015 -name "*.dng" -type f | wc -l
$ find Photos/Archive/2015 -name "*.CR?" -type f | wc -l
$ find Photos/Archive/2015 -name "*.CR?" -type f -delete

If you want to be really sure then it’s probably a good idea to first check that the DNG files are good before you delete all those RAW files. Perhaps view them all or import them to Lightroom. And when you delete all the RAW files, you might want to make sure that the converted DNG files exist. To do that I’ve written the follow shell script:

rawfiles=$(find "$1"  -name "*.CR2" -o -name "*.ORF" | sed 's/ /\\-/g' |sed 's/CR2\\-/CR2 /g' |sed 's/ORF\\-/ORF /g')
echo Only deleting RAW files with equivalent DNG files...
for entry in $rawfiles
fixentry=$(echo $entry | sed 's/\\-/ /g')
dngfile=$(echo $fixentry | sed 's/...$/dng/g')
xmpfile=$(echo $fixentry | sed 's/...$/xmp/g')
if [[ -f "$dngfile" && -f "$fixentry" ]]
        echo Deleting $fixentry
        rm "$fixentry"
        if [[ -f "$xmpfile" ]]
                echo Deleting $xmpfile
                rm "$xmpfile"

If the script was named then you use it like so:

$ ./ /Volumes/Photos/Archive/2015
Categories: Mac, Photography Tags: , ,

Useful keys on a MacBook Air with Finnish keyboard

November 24th, 2012 6 comments

Wow, it’s been two and a half years since my last post.  I don’t think blogging is my thing.  I think and plan too much about what to write and then never get around to it.  So instead, I think I’ll just use this space to write down stuff so I don’t forget.

For example, I can never remember how to type pipes or square brackets on my MacBook Air.  A quick Google doesn’t really help as it seems to be different on my Finnish keyboard.  So here’s a list of keys that I think are useful to know:

Pipe (|) = Alt + 7
Backslash (\) = Shift + Alt + 7
Open square bracket ([) = Alt + 8
Closed square bracket (]) = Alt + 9
Open curly bracket ({) = Shift + Alt + 8
Closed curly bracket (}) = Shift + Alt + 9
Dollar sign ($) = Alt + 4
Tilde (~) = Alt + ¨

Page up = Fn + Up
Page down = Fn + Down

Print screen = Cmd + Shift + 3
Partial print screen = Cmd + Shift + 4 (You get a cursor to select what to capture)
Print window = Cmd + Shift + 4 and then press Spacebar

Delete = Fn + Backspace
Delete file from Finder = Cmd + Backspace

Categories: Mac Tags: , , , ,

iPhone 3G with iOS4, jailbreak & unlock

June 30th, 2010 No comments

Right after iOS4 (formerly known as iPhone OS 4) was released I found out from the Dev-Team that it was already possible to jailbreak and unlock it.  The whole process is very easy so how could I resist?  Of course, there are a few different ways but here are the basic steps I followed:

  1. Update iPhone to standard iOS4 via iTunes.
  2. Run redsn0w (found HERE) and follow the on-screen instructions.
  3. Using Cydia, install ultrasn0w for carrier unlock.

The first thing I noticed was that my iPhone was now very slooow.  I guess iOS4 isn’t really meant for the iPhone 3G.  At least I haven’t heard of many 3Gs users complaining about the performance.  It’s kind of a trade-off though.  Apps are now a lot slower to load and respond.  On the other hand, iOS4 allows for apps to remain in memory and remember their state.  So switching between recently used apps is now much faster.

Another thing I noticed is the battery life.  It doesn’t last nearly as long anymore.  Personally, this isn’t really a problem for me because I will anyway charge almost everyday.  So as long as the battery lasts for a day (with iOS4, it probably lasts 2 days or so) then that’s enough for me.

As for the features, well, there are lots of reviews already out there.  All I want to say is that I like that I’m now able to organize my apps in folders.  It’s good to keep similar apps together and I can now make do with only 2 pages of apps.  I used to hate having to flip through several pages of apps to find the one I want to run.

Categories: iPhone Tags: , , , ,

WordPress 3.0 and Gallery 2

June 19th, 2010 2 comments

WordPress 3.0 was released the other day.  To my pleasant surprise, it appears that WPG2 (version 3.07) is still working fine.  WPG2 is a WordPress plugin that seamless integrates Gallery 2 (I’m using version 2.3.1) with WordPress.

I haven’t fully tested everything yet but so far I haven’t noticed any problems with the basic functionality.

Categories: Blogging Tags: , , ,

ScribeFire: Blogging Add-on for Firefox

January 27th, 2010 No comments

This is another test post and I’m using another cool tool for blogging.  This time it’s a Firefox add-on called ScribeFire.  It supports several blogging systems, including WordPress.  It has split-screen mode that opens an editor on the lower half of the browser window and leaves the upper half for browsing.  I guess this is perfect for blogging about stuff you see on the internet.  You can type and see the website(s) at the same time.

By the way, if you’re using WordPress and your web host is using a PHP version older than 5.2.9 then you might need to install a WordPress plugin called LibXML2 Fix.  This plugin is a “work around for some versions of libxml2 2.7.x that strip out brackets when parsing XML.

Categories: Blogging Tags: , ,

Windows Live Writer

January 24th, 2010 1 comment

This is test post.  I’m writing and publishing it using Windows Live Writer which is available as a free download for Windows.  Up to now, I’ve always been writing my posts online via the web interface.  If this works, I think it will be more convenient to use Live Writer.

I don’t know why I never thought of using a desktop blogging client before.  Then again, I’m not much of a blogger.  I rarely post anything.  Perhaps the added convenience of using a desktop client might get me writing more?  Nah, I doubt it.

Anyway, while we’re on the topic I thought I’d have a look at what other options are out there.  After a quick Google search, I found these articles:

I’m sure there are other clients out there better than Windows Live Writer but I can’t be bothered to test them. I’ll just use this one for now and see how it goes.  Of course, if anyone knows a much better alternative that’s also free then please let me know.

Here we go again

December 17th, 2009 5 comments

The webhosting company I was using is gone and so are my old sites.  I have a lot of old files but no recent database backup.  So it’s easier if I just start over.

One of my old sites was my Dev Site where I had quite many WordPress themes that were optimized (modified) for use with WPG2 (a plugin that integrates WordPress with Gallery).  I’ll try to add them to this site but they’re mostly old themes and may not be compatible with the latest versions of WordPress and WPG2.

In the meantime, there’s still a lot of rebuilding work to be done…

Categories: General Tags: , , ,