mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
shutterspeed fraction fix
This commit is contained in:
parent
f12cb6d1d9
commit
c9056e0015
@ -4,7 +4,7 @@ const yaml = require('js-yaml')
|
|||||||
const { createFilePath } = require('gatsby-source-filesystem')
|
const { createFilePath } = require('gatsby-source-filesystem')
|
||||||
const { paginate } = require('gatsby-awesome-pagination')
|
const { paginate } = require('gatsby-awesome-pagination')
|
||||||
const fastExif = require('fast-exif')
|
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 meta = yaml.load(fs.readFileSync('./content/meta.yml', 'utf8'))
|
||||||
const { itemsPerPage } = meta
|
const { itemsPerPage } = meta
|
||||||
@ -71,13 +71,13 @@ const generateExif = (exifData, createNodeField, node) => {
|
|||||||
ExposureBiasValue
|
ExposureBiasValue
|
||||||
} = exifData.exif
|
} = exifData.exif
|
||||||
|
|
||||||
const { numerator, denominator } = new Fraction(ExposureTime)
|
const { n, d } = new Fraction(ExposureTime)
|
||||||
const exposureShortened = parseFloat(ExposureBiasValue.toFixed(2))
|
const exposureShortened = parseFloat(ExposureBiasValue.toFixed(2))
|
||||||
|
|
||||||
const model = `${Model}`
|
const model = `${Model}`
|
||||||
const iso = `ISO ${ISO}`
|
const iso = `ISO ${ISO}`
|
||||||
const fstop = `ƒ ${FNumber}`
|
const fstop = `ƒ ${FNumber}`
|
||||||
const shutterspeed = `${numerator}/${denominator}s`
|
const shutterspeed = `${n}/${d}s`
|
||||||
const focalLength = `${FocalLength}mm`
|
const focalLength = `${FocalLength}mm`
|
||||||
|
|
||||||
let exposure
|
let exposure
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-exif": "^1.0.1",
|
"fast-exif": "^1.0.1",
|
||||||
"fractional": "^1.0.0",
|
"fraction.js": "^4.0.9",
|
||||||
"gatsby": "^2.0.0-rc.21",
|
"gatsby": "^2.0.0-rc.21",
|
||||||
"gatsby-awesome-pagination": "^0.1.1",
|
"gatsby-awesome-pagination": "^0.1.1",
|
||||||
"gatsby-image": "^2.0.0-rc.2",
|
"gatsby-image": "^2.0.0-rc.2",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.exif {
|
.exif {
|
||||||
font-size: $font-size-mini;
|
font-size: $font-size-mini;
|
||||||
color: $brand-grey-light;
|
color: $brand-grey-light;
|
||||||
margin-top: -($spacer * 1.5);
|
margin-top: -($spacer * 1.25);
|
||||||
margin-bottom: $spacer * 2;
|
margin-bottom: $spacer * 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
Loading…
Reference in New Issue
Block a user