aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/assets/picture.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/assets/picture.html b/src/assets/picture.html
index c617c05..6f3058f 100644
--- a/src/assets/picture.html
+++ b/src/assets/picture.html
@@ -169,6 +169,13 @@
if (e.keyCode == 32) document.getElementById("toggle").checked = true;
}
+ function formatShutterSpeed (d) {
+ if (d >= 1) {
+ return Math.round(d*10)/10 + 's';
+ }
+ return '1/' + Math.round(1/d) + 's';
+ }
+
function getExif() {
let image = document.getElementById("image");
@@ -178,7 +185,7 @@
document.getElementById("attr_captured").innerHTML = EXIF.getTag(this, "DateTimeOriginal");
document.getElementById("attr_make").innerHTML = EXIF.getTag(this, "Make");
document.getElementById("attr_type/model").innerHTML = EXIF.getTag(this, "Model");
- document.getElementById("attr_shutter-speed").innerHTML = EXIF.getTag(this, "ExposureTime") + ' s';
+ document.getElementById("attr_shutter-speed").innerHTML = formatShutterSpeed(EXIF.getTag(this, "ExposureTime"));
document.getElementById("attr_shutter-program").innerHTML = EXIF.getTag(this, "ExposureProgram");
document.getElementById("attr_aperture").innerHTML = EXIF.getTag(this, "FNumber");
document.getElementById("attr_focal-length").innerHTML = EXIF.getTag(this, "FocalLength") + 'mm';