added basic stuff to metadata...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-19 01:23:47 +03:00
parent cf3b189383
commit 12f66c2e40

View File

@ -85,6 +85,7 @@ module.Metadata = core.ImageGridFeatures.Feature({
// Array with attributes, make it an object... // Array with attributes, make it an object...
var MetadataReaderActions = actions.Actions({ var MetadataReaderActions = actions.Actions({
// XXX should this be sync??? // XXX should this be sync???
// XXX add support to taskqueue...
// XXX should this process multiple images??? // XXX should this process multiple images???
// XXX also check the metadata/ folder (???) // XXX also check the metadata/ folder (???)
// XXX this uses .markChanged(..) form filesystem.FileSystemWriter // XXX this uses .markChanged(..) form filesystem.FileSystemWriter
@ -233,9 +234,21 @@ module.MetadataReader = core.ImageGridFeatures.Feature({
// XXX show all fields but make some of them hidden/disabled // XXX show all fields but make some of them hidden/disabled
// -- togglable via D // -- togglable via D
// XXX add field editing... (open) // XXX add field editing... (open)
// XXX might be good to split this to sections...
// - base info
// - general metadata
// - full metadata
// - EXIF
// - IPTC
// - ...
var MetadataUIActions = actions.Actions({ var MetadataUIActions = actions.Actions({
config: { config: {
'metadata-field-order': [ 'metadata-field-order': [
// image attrs...
'GID', 'Index (ribbon)', 'Index (global)',
'File Name', 'Full Path',
// metadata...
'Make', 'Camera Model Name', 'Lens ID', 'Lens', 'Lens Profile Name', 'Focal Length', 'Make', 'Camera Model Name', 'Lens ID', 'Lens', 'Lens Profile Name', 'Focal Length',
'Metering Mode', 'Exposure Program', 'Exposure Compensation', 'Metering Mode', 'Exposure Program', 'Exposure Compensation',
@ -269,9 +282,31 @@ var MetadataUIActions = actions.Actions({
&& this.images[image] && this.images[image]
&& this.images[image].metadata) && this.images[image].metadata)
|| { metadata: 'unavailable.' } || { metadata: 'unavailable.' }
var img = this.images && this.images[image] || null
// base fields...
var fields = [
['GID: ', image],
// NOTE: these are 1-based and not 0-based...
['Index (ribbon): ',
this.data.getImageOrder('ribbon', image) + 1
+'/'+
this.data.getImages(image).len],
['Index (global): ',
this.data.getImageOrder(image) + 1
+'/'+
this.data.getImages().len],
]
// fields that expect that image data is available...
if(img){
fields = fields.concat([
['File Name: ', img.path],
// XXX normalize this...
['Full Path: ', (img.base_path || '.') +'/'+ img.path],
])
}
// build fields... // build fields...
var fields = []
Object.keys(metadata).forEach(function(k){ Object.keys(metadata).forEach(function(k){
var n = k var n = k
// convert camel-case to human-case ;) // convert camel-case to human-case ;)