]> git.scottworley.com Git - picsort/blobdiff - picsorter.js
Support .jpeg files mixed in with .NEF files
[picsort] / picsorter.js
index db81f058b13c4a4d0a08bf9fc383d87325039956..b1c1bdf5b726220f97adf9af55c47d533f21d6ec 100644 (file)
@@ -28,13 +28,19 @@ function stripFromEnd(str, suffix) {
 }
 
 function setpic() {
-  if ("exposure" in picinfo[files[input_index]]) {
-    exposure = picinfo[files[input_index]].exposure;
+  var display_filename;
+  if (endsWith(files[input_index], ".NEF")) {
+    if ("exposure" in picinfo[files[input_index]]) {
+      exposure = picinfo[files[input_index]].exposure;
+    } else {
+      picinfo[files[input_index]].exposure = exposure;
+      save_picinfo();
+    }
+    display_filename = zoom + exposure + "/" + stripFromEnd(files[input_index], ".NEF") + ".jpeg";
   } else {
-    picinfo[files[input_index]].exposure = exposure;
-    save_picinfo();
+    display_filename = zoom + files[input_index];
   }
-  $("#pic").attr("src", zoom + exposure + "/" + files[input_index]);
+  $("#pic").attr("src", display_filename);
 }
 
 function say(message) {