mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-26 04:51:57 +00:00
Compare commits
4 Commits
02003b3b14
...
6abd1ed3e0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6abd1ed3e0 | |||
| ebb6d282f1 | |||
| 78891e7d22 | |||
| d699e22970 |
@ -154,6 +154,6 @@ Leading `"-"` indicates a not fully sorted shoot.
|
||||
- <date> - <info>/
|
||||
```
|
||||
|
||||
This is the defailt as creatrd by `sync-flash.sh`, renaming (removing the leading `"- "`) should be done by the user.
|
||||
This is the default as created by `sync-flash.sh`, renaming (removing the leading `"- "`) should be done by the user.
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
Base photo archive directory
|
||||
----------------------------
|
||||
# Base photo archive directory
|
||||
|
||||
This tree is created based on the specification from:
|
||||
https://github.com/flynx/ImageGrid/blob/master/Archive/README.md
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# TODO make this runnable from anywhere...
|
||||
# - prepend paths with './' only if local/relative
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
#######################################################################
|
||||
#
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION=1.0
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
|
||||
@ -113,6 +113,9 @@ var MetadataReaderActions = actions.Actions({
|
||||
- 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(..)
|
||||
`,
|
||||
core.sessionQueueHandler('Read image metadata',
|
||||
@ -135,14 +138,17 @@ var MetadataReaderActions = actions.Actions({
|
||||
if(!image && !img){
|
||||
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 = 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){
|
||||
if(err){
|
||||
return reject(err) }
|
||||
@ -157,18 +163,41 @@ var MetadataReaderActions = actions.Actions({
|
||||
img.ctime = stat.ctime
|
||||
img.birthtime = stat.birthtime
|
||||
|
||||
img.size = stat.size
|
||||
}
|
||||
img.size = stat.size }
|
||||
|
||||
// read image metadata...
|
||||
exiftool.metadata(file, function(err, data){
|
||||
if(err){
|
||||
reject(err)
|
||||
|
||||
} else if(data.error){
|
||||
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...
|
||||
return Promise.all(readers)
|
||||
.then(function(data){
|
||||
// convert to a real dict...
|
||||
// NOTE: exiftool appears to return an array
|
||||
// object rather than an actual dict/object
|
||||
@ -177,16 +206,14 @@ var MetadataReaderActions = actions.Actions({
|
||||
Object.assign(
|
||||
// XXX do we need to update or overwrite??
|
||||
that.images[gid].metadata || {},
|
||||
data,
|
||||
...data,
|
||||
{
|
||||
ImageGridMetadataReader: 'exiftool/ImageGrid',
|
||||
// mark metadata as full read...
|
||||
ImageGridMetadata: 'full',
|
||||
})
|
||||
that.markChanged
|
||||
&& that.markChanged('images', [gid]) }
|
||||
|
||||
resolve(data) }) }) }) })],
|
||||
&& that.markChanged('images', [gid]) }) })],
|
||||
// XXX Q: should this be a linked task???
|
||||
// ...on one hand yes, on the other, saving after this may
|
||||
// unintentionally save other state from the main object...
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ImageGrid.Viewer.g4",
|
||||
"main": "index.html",
|
||||
"version": "4.0.10a",
|
||||
"version": "4.0.11a",
|
||||
"author": "Alex A. Naanou <alex.nanou@gmail.com> (https://github.com/flynx)",
|
||||
"contributors": [],
|
||||
"repository": "github:flynx/ImageGrid",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user