booh sort by exif date: fallback on filename content if exif date failed (many device...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 7 Nov 2013 22:00:33 +0000 (23:00 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 7 Nov 2013 22:07:44 +0000 (23:07 +0100)
bin/booh

index a58caec..0a5ca37 100644 (file)
--- a/bin/booh
+++ b/bin/booh
@@ -2359,6 +2359,8 @@ def sort_by_exif_date
                 date_time = Exif.datetimeoriginal(from_utf8($current_path + "/" + f))
                 if ! date_time.nil?
                     dates[f] = date_time
+                elsif f =~ /(20\d{2}).?(\d{2}).?(\d{2}).(\d{2}).?(\d{2}).?(\d{2})/
+                    dates[f] = "#$1:#$2:#$3 #$4:#$5:#$6"
                 end
             end
             if aborted
@@ -2375,6 +2377,8 @@ def sort_by_exif_date
             date_time = Exif.datetimeoriginal(from_utf8($current_path + "/" + f))
             if ! date_time.nil?
                 dates[f] = date_time
+            elsif f =~ /(20\d{2}).?(\d{2}).?(\d{2}).(\d{2}).?(\d{2}).?(\d{2})/
+                dates[f] = "#$1:#$2:#$3 #$4:#$5:#$6"
             end
         }
     end