renamed 'exif' stuff to a more general 'metadata' stuff...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-12 04:33:10 +03:00
parent 5bbe479fcb
commit af0754b3a6
3 changed files with 34 additions and 38 deletions

View File

@ -24,11 +24,10 @@ var core = require('features/core')
/*********************************************************************/ /*********************************************************************/
// XXX rename: EXIF -> Metadata
// XXX make metadata a prop of image... // XXX make metadata a prop of image...
var EXIFActions = actions.Actions({ var MetadataActions = actions.Actions({
getExif: ['- Image/Get exif data', getMetadata: ['- Image/Get metadata data',
function(image){ function(image){
var gid = this.data.getImage(image) var gid = this.data.getImage(image)
@ -37,7 +36,7 @@ var EXIFActions = actions.Actions({
} }
return null return null
}], }],
setExif: ['- Image/Set exif data', setMetadata: ['- Image/Set metadata data',
function(image, metadata, merge){ function(image, metadata, merge){
var that = this var that = this
var gid = this.data.getImage(image) var gid = this.data.getImage(image)
@ -56,12 +55,12 @@ var EXIFActions = actions.Actions({
}] }]
}) })
var EXIF = var Metadata =
module.EXIF = core.ImageGridFeatures.Feature({ module.Metadata = core.ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
tag: 'exif', tag: 'metadata',
depends: [ depends: [
'base', 'base',
], ],
@ -69,23 +68,23 @@ module.EXIF = core.ImageGridFeatures.Feature({
isApplicable: function(){ isApplicable: function(){
return this.runtime == 'nw' || this.runtime == 'node' }, return this.runtime == 'nw' || this.runtime == 'node' },
actions: EXIFActions, actions: MetadataActions,
}) })
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Exif reader/writer... // Metadata reader/writer...
// XXX add exif writer... // XXX add Metadata writer...
var EXIFReaderActions = actions.Actions({ var MetadataReaderActions = actions.Actions({
// XXX should this be sync??? // XXX should this be sync???
// 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
// feature, but technically does not depend on it... // feature, but technically does not depend on it...
// XXX should we store metadata in an image (current) or in fs??? // XXX should we store metadata in an image (current) or in fs???
readExif: ['- Image/Get exif data', readMetadata: ['- Image/Get metadata data',
function(image, force){ function(image, force){
var that = this var that = this
@ -123,19 +122,19 @@ var EXIFReaderActions = actions.Actions({
}) })
}], }],
// XXX take image exif and write it to target... // XXX take image Metadata and write it to target...
writeExif: ['- Image/Set exif data', writeMetadata: ['- Image/Set metadata data',
function(image, target){ function(image, target){
// XXX // XXX
}] }]
}) })
var EXIFReader = var MetadataReader =
module.EXIF = core.ImageGridFeatures.Feature({ module.Metadata = core.ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
tag: 'exif-reader', tag: 'metadata-reader',
depends: [ depends: [
'base', 'base',
], ],
@ -143,13 +142,13 @@ module.EXIF = core.ImageGridFeatures.Feature({
isApplicable: function(){ isApplicable: function(){
return this.runtime == 'nw' || this.runtime == 'node' }, return this.runtime == 'nw' || this.runtime == 'node' },
actions: EXIFReaderActions, actions: MetadataReaderActions,
}) })
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Exif editor/viewer... // Metadata editor/viewer...
// //
// XXX first instinct is to use browse with editable fields as it will // XXX first instinct is to use browse with editable fields as it will
// give us: // give us:
@ -167,46 +166,42 @@ module.EXIF = core.ImageGridFeatures.Feature({
// ...need to think about this... // ...need to think about this...
// XXX this should basically be platform independent... // XXX this should basically be platform independent...
var EXIFUIActions = actions.Actions({ var MetadataUIActions = actions.Actions({
showExif: ['Image/Show exif', showMetadata: ['Image/Show metadata',
function(image, force){ function(image, force){
image = this.data.getImage(image) image = this.data.getImage(image)
var exif = !force
&& this.images[image].metadata
|| this.getExif(image, force)
// XXX make a list with two .text elements per list item: // XXX make a list with two .text elements per list item:
// .text.field - exif field name // .text.field - metadata field name
// .text.value - exif field value // .text.value - metadata field value
// Add CSS: // Add CSS:
// .exif-browser .list>div .text { // .metadata-browser .list>div .text {
// display: inline-block; // display: inline-block;
// width: 50%; // width: 50%;
// } // }
// .exif-browser .list>div .text:first-child { // .metadata-browser .list>div .text:first-child {
// text-align: right; // text-align: right;
// } // }
// .exif-browser .list>div .text:first-child:after { // .metadata-browser .list>div .text:first-child:after {
// content: ": "; // content: ": ";
// } // }
// .exif-browser .list>div .text:last-child { // .metadata-browser .list>div .text:last-child {
// } // }
}] }]
}) })
// XXX // XXX
var EXIFUI = var MetadataUI =
module.EXIFUI = core.ImageGridFeatures.Feature({ module.MetadataUI = core.ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
tag: 'ui-exif', tag: 'ui-metadata',
depends: [ depends: [
'ui', 'ui',
'exif', 'metadata',
], ],
actions: EXIFUIActions, actions: MetadataUIActions,
}) })

View File

@ -82,7 +82,8 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'ui-fs-url-history', 'ui-fs-url-history',
'ui-fs-writer', 'ui-fs-writer',
'exif', 'metadata',
'ui-metadata',
'external-editor', 'external-editor',
'ui-external-editor', 'ui-external-editor',

View File

@ -356,7 +356,7 @@ actions.Actions({
} }
}, 50) }, 50)
}], }],
alignByFirst: ['Interface/Aling ribbons except current to first image', alignByFirst: ['Interface/Align ribbons except current to first image',
function(target){ function(target){
var ribbons = this.ribbons var ribbons = this.ribbons
var data = this.data var data = this.data