1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 18:00:06 +01:00

shutterspeed fraction fix

This commit is contained in:
Matthias Kretschmann 2018-09-12 23:36:05 +02:00
parent f12cb6d1d9
commit c9056e0015
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ const yaml = require('js-yaml')
const { createFilePath } = require('gatsby-source-filesystem')
const { paginate } = require('gatsby-awesome-pagination')
const fastExif = require('fast-exif')
const { Fraction } = require('fractional')
const Fraction = require('fraction.js')
const meta = yaml.load(fs.readFileSync('./content/meta.yml', 'utf8'))
const { itemsPerPage } = meta
@ -71,13 +71,13 @@ const generateExif = (exifData, createNodeField, node) => {
ExposureBiasValue
} = exifData.exif
const { numerator, denominator } = new Fraction(ExposureTime)
const { n, d } = new Fraction(ExposureTime)
const exposureShortened = parseFloat(ExposureBiasValue.toFixed(2))
const model = `${Model}`
const iso = `ISO ${ISO}`
const fstop = `ƒ ${FNumber}`
const shutterspeed = `${numerator}/${denominator}s`
const shutterspeed = `${n}/${d}s`
const focalLength = `${FocalLength}mm`
let exposure

View File

@ -23,7 +23,7 @@
],
"dependencies": {
"fast-exif": "^1.0.1",
"fractional": "^1.0.0",
"fraction.js": "^4.0.9",
"gatsby": "^2.0.0-rc.21",
"gatsby-awesome-pagination": "^0.1.1",
"gatsby-image": "^2.0.0-rc.2",

View File

@ -4,7 +4,7 @@
.exif {
font-size: $font-size-mini;
color: $brand-grey-light;
margin-top: -($spacer * 1.5);
margin-top: -($spacer * 1.25);
margin-bottom: $spacer * 2;
display: flex;
flex-wrap: wrap;