]> git.scottworley.com Git - picsort/commitdiff
Save per-pic exposures
authorScott Worley <scottworley@scottworley.com>
Fri, 28 Feb 2014 09:02:02 +0000 (01:02 -0800)
committerScott Worley <scottworley@scottworley.com>
Fri, 28 Feb 2014 09:02:02 +0000 (01:02 -0800)
picsorter.js

index 808855bcbb83477dc76d0e7bf93b40f1dd5eeecd..abed5075f22ccd8aaaf5261df712edbb1a9f6759 100644 (file)
@@ -15,6 +15,12 @@ var input_index = -1;
 
 
 function setpic() {
+  if ("exposure" in picinfo[files[input_index]]) {
+    exposure = picinfo[files[input_index]].exposure;
+  } else {
+    picinfo[files[input_index]].exposure = exposure;
+    localStorage.picsorter_picinfo = JSON.stringify(picinfo);
+  }
   $("#pic").attr("src", zoom + exposure + "/" + files[input_index]);
 }
 
@@ -54,6 +60,7 @@ function mark_not_deleted() {
 
 function change_exposure(amount) {
   exposure += amount;
+  picinfo[files[input_index]].exposure = exposure;
   setpic();
   var display_exposure = (exposure / 4) - 3.5;
   say((display_exposure >= 0 ? "+" : "") + display_exposure);