Skip to content

Commit

Permalink
Load and save image tint/temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Jul 14, 2020
1 parent f6e54b3 commit 12dfe0c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/commands/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class Save extends Command {
state.project
])

const params = { id, timestamp: meta.now, ...data }
let params = { id, timestamp: meta.now, ...data }

yield call(db.transaction, async tx => {
await mod.photo.save(tx, params, project)
Expand Down
2 changes: 2 additions & 0 deletions src/common/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const props = {
'negative',
'saturation',
'sharpen',
'temperature',
'tint',
'width'
],

Expand Down
16 changes: 2 additions & 14 deletions src/models/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@ const assert = require('assert')
const subject = require('./subject')
const { select, update } = require('../common/query')
const { empty, pick } = require('../common/util')

const COLUMNS = [
'width',
'height',
'angle',
'mirror',
'negative',
'brightness',
'contrast',
'hue',
'saturation',
'sharpen'
]
const { props } = require('../common/export')

module.exports = {
async rotate(db, { id, by }) {
Expand All @@ -40,7 +28,7 @@ module.exports = {
},

async save(db, { id, timestamp, ...data }) {
let image = pick(data, COLUMNS)
let image = pick(data, props.image)
if (empty(image)) return

assert(id != null, 'missing image id')
Expand Down
2 changes: 2 additions & 0 deletions src/models/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ module.exports = {
hue,
saturation,
sharpen,
temperature,
tint,
width,
height,
path,
Expand Down
2 changes: 2 additions & 0 deletions src/models/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const mod = {
hue,
saturation,
sharpen,
temperature,
tint,
template,
datetime(created, "localtime") AS created,
datetime(modified, "localtime") AS modified
Expand Down

0 comments on commit 12dfe0c

Please sign in to comment.