Compare commits

..

No commits in common. "6abd1ed3e0a6f5b9ba08c7c6f7196a49e8efba81" and "02003b3b140ccd4d43d375e2930c3a0f3217d2c5" have entirely different histories.

8 changed files with 34 additions and 60 deletions

View File

@ -154,6 +154,6 @@ Leading `"-"` indicates a not fully sorted shoot.
- <date> - <info>/ - <date> - <info>/
``` ```
This is the default as created by `sync-flash.sh`, renaming (removing the leading `"- "`) should be done by the user. This is the defailt as creatrd by `sync-flash.sh`, renaming (removing the leading `"- "`) should be done by the user.

View File

@ -1,4 +1,5 @@
# Base photo archive directory Base photo archive directory
----------------------------
This tree is created based on the specification from: This tree is created based on the specification from:
https://github.com/flynx/ImageGrid/blob/master/Archive/README.md https://github.com/flynx/ImageGrid/blob/master/Archive/README.md

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
# TODO make this runnable from anywhere... # TODO make this runnable from anywhere...
# - prepend paths with './' only if local/relative # - prepend paths with './' only if local/relative

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
# #
####################################################################### #######################################################################
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
VERSION=1.0 VERSION=1.0

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash

View File

@ -113,9 +113,6 @@ var MetadataReaderActions = actions.Actions({
- force is true - force is true
NOTE: this will read metadata from both the image file as well as sidecar
(xmp) files, if available
NOTE: sidecar metadata fields take precedence over image metadata.
NOTE: also see: .cacheMetadata(..) NOTE: also see: .cacheMetadata(..)
`, `,
core.sessionQueueHandler('Read image metadata', core.sessionQueueHandler('Read image metadata',
@ -138,17 +135,14 @@ var MetadataReaderActions = actions.Actions({
if(!image && !img){ if(!image && !img){
return false } return false }
if(!force
&& (img.metadata || {}).ImageGridMetadata == 'full'){
return Promise.resolve(img.metadata) }
//var full_path = path.normalize(img.base_path +'/'+ img.path) //var full_path = path.normalize(img.base_path +'/'+ img.path)
var full_path = this.getImagePath(gid) var full_path = this.getImagePath(gid)
return new Promise(function(resolve, reject){
if(!force
&& (img.metadata || {}).ImageGridMetadata == 'full'){
return resolve(img.metadata) }
var readers = []
// main image...
readers.push(new Promise(function(resolve, reject){
fs.readFile(full_path, function(err, file){ fs.readFile(full_path, function(err, file){
if(err){ if(err){
return reject(err) } return reject(err) }
@ -163,41 +157,18 @@ var MetadataReaderActions = actions.Actions({
img.ctime = stat.ctime img.ctime = stat.ctime
img.birthtime = stat.birthtime img.birthtime = stat.birthtime
img.size = stat.size } img.size = stat.size
}
// read image metadata... // read image metadata...
exiftool.metadata(file, function(err, data){ exiftool.metadata(file, function(err, data){
if(err){ if(err){
reject(err) reject(err)
} else if(data.error){ } else if(data.error){
reject(data) reject(data)
} else {
resolve(data) } }) }) }) )
// XMP sidecar files...
// NOTE: sidecar files take precedence over image metadata...
for(var ext of ['xmp', 'XMP']){
var xmp_path = full_path.replace(/\.[a-zA-Z0-9]*$/, '.'+ ext)
if(fs.existsSync(xmp_path)){
readers.push(new Promise(function(resolve, reject){
fs.readFile(xmp_path, function(err, file){
if(err){
// XXX log error...
resolve({}) }
exiftool.metadata(file, function(err, data){
if(err){
// XXX log error...
resolve({})
} else if(data.error){
// XXX log error...
resolve({})
} else {
console.log("@@@@", data)
resolve(data) } }) }) }))
break } }
// merge the data... } else {
return Promise.all(readers)
.then(function(data){
// convert to a real dict... // convert to a real dict...
// NOTE: exiftool appears to return an array // NOTE: exiftool appears to return an array
// object rather than an actual dict/object // object rather than an actual dict/object
@ -206,14 +177,16 @@ var MetadataReaderActions = actions.Actions({
Object.assign( Object.assign(
// XXX do we need to update or overwrite?? // XXX do we need to update or overwrite??
that.images[gid].metadata || {}, that.images[gid].metadata || {},
...data, data,
{ {
ImageGridMetadataReader: 'exiftool/ImageGrid', ImageGridMetadataReader: 'exiftool/ImageGrid',
// mark metadata as full read... // mark metadata as full read...
ImageGridMetadata: 'full', ImageGridMetadata: 'full',
}) })
that.markChanged that.markChanged
&& that.markChanged('images', [gid]) }) })], && that.markChanged('images', [gid]) }
resolve(data) }) }) }) })],
// XXX Q: should this be a linked task??? // XXX Q: should this be a linked task???
// ...on one hand yes, on the other, saving after this may // ...on one hand yes, on the other, saving after this may
// unintentionally save other state from the main object... // unintentionally save other state from the main object...

View File

@ -1,7 +1,7 @@
{ {
"name": "ImageGrid.Viewer.g4", "name": "ImageGrid.Viewer.g4",
"main": "index.html", "main": "index.html",
"version": "4.0.11a", "version": "4.0.10a",
"author": "Alex A. Naanou <alex.nanou@gmail.com> (https://github.com/flynx)", "author": "Alex A. Naanou <alex.nanou@gmail.com> (https://github.com/flynx)",
"contributors": [], "contributors": [],
"repository": "github:flynx/ImageGrid", "repository": "github:flynx/ImageGrid",