Aurélien's room

I mess with user interfaces, write code (mostly Qt & KDE stuff) and occasionally rant, but I (usually) don't bite

Oups, my burst shots are all shuffled!

At the end of December my wife and I were invited with other parents to my daughter last dance lesson of the year.

Of course, I brought my camera with me. I shot a little bit more than 160 pictures from the one hour lesson (if that sounds like a crazy number, then you probably don’t have kids…).

Some of them were shot in burst mode, where the camera continuously takes a few pictures per second, increasing the chances the wannabe photographer gets at least one decent picture (and partially explaining the embarrassing large number of shots…)

Importing, aka, the mistake

Back home, I imported the pictures with Gwenview importer and started to comb through them to get rid of the cruft.

Burst mode is fun, but Gwenview importer does not play nice with it: by default it renames imported pictures using the shot date found in the image EXIF information. I like this feature because I find it more expressive to have a picture named “2011-12-17_12-47-47.jpg” than “pict0234.jpg”. It has one big drawback though: the precision of time information stored in EXIF is one second. When one shoots in burst mode, more than one picture per second is produced… In such a situation, Gwenview importer inserts a “_n” suffix just before the extension dot, where “n” starts at “1″ and is increased until the importer can create a file name which does not exist. It gets even a bit nastier when you realize Gwenview importer does not necessarily import pictures in file order, meaning the “n” values do not necessarily match the order in which the pictures were taken… not good.

Workarounds

I want to address this issue correctly in KDE SC 4.9, but meanwhile here are some workarounds.

If you haven’t yet imported your burst-mode pictures, you can either disable image renaming altogether or change the “Rename Format” from “{date}_{time}.{ext.lower}” to “{date}_{time}_{name.lower}.{ext.lower}”. This way imported images will still carry the original image name and will be properly ordered. File names will be a bit ugly, but at least you will be safe.

Configuring Gwenview importer to append the original file name at the end of imported pictures
Configuring Gwenview importer to append the original file name at the end of imported pictures

If you have already imported the pictures it gets a bit more tricky. I looked at the EXIF information my camera recorded and noticed pictures have a “Exif.Panasonic.SequenceNumber” tag (yes, that sounds vendor-specific :/). This tag is set to 0 for normal pictures, but starts at 1 and goes up for burst-mode pictures. I thus put together “pict-exif-rename”, a quick Python script using pyexiv2 to rename all images, appending a suffix based on the sequence number if it is greater than 0.

I pushed “pict-exif-rename” as a github gist, maybe you will find it useful.

It would be interesting to hear from different camera owners about the presence of the “Exif.Panasonic.SequenceNumber” tag (or an equivalent). You can quickly check its presence by running “exiv2 -Pkv a_picture.jpg | grep SequenceNumber”. All pictures taken with my camera (Panasonic DMC-FS16) have this tag, it is set to 0 for non burst-mode pictures.


Flattr this

Advertisement

8 Responses to Oups, my burst shots are all shuffled!

  1. Fri13 January 5, 2012 at 2:47

    Photographers rule of thumb…. Or actually rule of hand as you have five fingers…

    Only 5% of the photographers are good and only 5% of them are great/awesome.

    That 5% does not change matter how many you take, you just get better rate to have good and awesome photos.

    From 100 photos you have only 5 good photos. From 1 000 photos you have 50 good photos. From those 50 good photos you have 2-3 great/awesome photos.

    So when you have 100 000 photographs, you have 5 000 good photos and only a 250 great/awesome photos.

    And when you have 50 great or awesome photos, you can fill small gallery with them. When you have 250, you can fill big gallery.
    But only for great CV you need 10-15 great/awesome photos. So you need to take at east about 7500-10 000 photographs.

    So after all, using a burst mode isn’t “bad thing”, you just might miss the great/awesome time with it.

  2. Damon Lynch January 5, 2012 at 7:11

    Hi Aurélien, Rapid Photo Downloader has many options for sequence numbers and Exif based renaming.

  3. kb January 5, 2012 at 12:56

    A while ago I made a one-off very simplistic imageviewer (using exiv2 + Qt, even) that solved this problem by using Nikons ImageCount tag and the camera SerialNumber (in case you had a folder with overlapping burst-sequences from multiple cameras). If you want that (very badly written) code, mail me.

  4. JDG January 17, 2012 at 1:51

    Some cameras have a “file number” that they record in the EXIF Maker notes. For example, Canon uses “FileNumber”. This usually matches up with the number that you see in the filename. This number is sequential, and thus implies order.

    Therefore, a naming template like this might work: {date}_{time}_{seq-num}.{ext.lower} (assuming that you make {seq-num} map to the maker specific data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.