aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorctucx <c@ctu.cx>2020-06-13 22:26:02 +0200
committerctucx <c@ctu.cx>2020-06-13 22:26:02 +0200
commit82602f51c5e59a6a005736076a39e893585a93f7 (patch)
tree3d155ad9bc91a494dc55876d4788528c29620f8d
parent6d3ffe4fd1b24cf6a8f11e8c118173145a972429 (diff)
downloadgallery-82602f51c5e59a6a005736076a39e893585a93f7.tar.gz
gallery-82602f51c5e59a6a005736076a39e893585a93f7.tar.bz2
gallery-82602f51c5e59a6a005736076a39e893585a93f7.zip
show shutterspeed correctly
-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';