added export of current image...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-04-07 04:18:30 +03:00
parent f312eee12f
commit 42ead16808
3 changed files with 52 additions and 7 deletions

View File

@ -288,8 +288,8 @@ while true ; do
while true ; do while true ; do
echo "Copying files from ${BASE}${DRIVE} (~`du -hs "${BASE}${DRIVE}" | cut -f 1`)..." echo "Copying files from ${BASE}${DRIVE} (~`du -hs "${BASE}${DRIVE}" | cut -f 1`)..."
echo "# $COPY $COPYFLAGS ${BASE}${DRIVE}/* "$DIR"" #echo "# $COPY $COPYFLAGS ${BASE}${DRIVE}/* "$DIR""
echo "# 2> >(tee "${DIR}"/copy-err.log)" #echo "# 2> >(tee "${DIR}"/copy-err.log)"
$COPY $COPYFLAGS ${BASE}${DRIVE}/* "$DIR" \ $COPY $COPYFLAGS ${BASE}${DRIVE}/* "$DIR" \
2> >(tee "${DIR}"/copy-err.log) 2> >(tee "${DIR}"/copy-err.log)
# no errors -> remove log... # no errors -> remove log...
@ -358,7 +358,7 @@ fi
if ! [ -z "$SNAPSHOT" ] \ if ! [ -z "$SNAPSHOT" ] \
&& [ -e "$SNAPSHOT" ] ; then && [ -e "$SNAPSHOT" ] ; then
eval "$SNAPSHOT" "$SNAPSHOT"
fi fi
# XXX add report... # XXX add report...

View File

@ -2386,8 +2386,8 @@ var FileSystemWriterActions = actions.Actions({
exportImages: ['- File/Export/Export ribbons as directories', exportImages: ['- File/Export/Export ribbons as directories',
core.doc`Export ribbons as directories core.doc`Export ribbons as directories
.exportImages(path) .exportImages([images, ]path)
.exportImages(settings) .exportImages([images, ]settings)
settings format: settings format:
@ -2416,12 +2416,35 @@ var FileSystemWriterActions = actions.Actions({
var that = this var that = this
var base_dir = this.location.path var base_dir = this.location.path
var images
if(path == 'current'
|| path instanceof Array){
images = path
;[path, pattern, level_dir, size, include_virtual, clean_target_dir, logger]
= [...arguments].slice(1) }
var settings
if(path && typeof(path) != typeof('str')){ if(path && typeof(path) != typeof('str')){
settings = path settings = path
path = settings.path } path = settings.path }
settings = settings settings = settings
|| this.config['export-settings'] || this.config['export-settings']
|| {} || {}
images = (images
?? settings.images)
|| images
if(images != null){
images =
typeof(images) == 'string' ?
(this.data.getImage(images)
?? this.data.getImages(images))
: this.data.getImages(images)
images = new Set(
images instanceof Array ?
images
: [images] ) }
// XXX resolve env variables in path... // XXX resolve env variables in path...
// ...also add ImageGrid specifics: $IG_INDEX, ... // ...also add ImageGrid specifics: $IG_INDEX, ...
// XXX // XXX
@ -2489,6 +2512,10 @@ var FileSystemWriterActions = actions.Actions({
var total_len = that.data.length var total_len = that.data.length
that.data.ribbons[ribbon].forEach(function(gid){ that.data.ribbons[ribbon].forEach(function(gid){
if(images != null
&& ! images.has(gid)){
return }
var img = that.images[gid] var img = that.images[gid]
// XXX get/form image name... // XXX get/form image name...
@ -2554,7 +2581,9 @@ var FileSystemWriterActions = actions.Actions({
'/'+level_dir '/'+level_dir
: '' : ''
return res })) }] return res })) }],
exportImage: ['- File/Export/Export current image',
'exportImages: "current" ... -- '],
}) })
@ -2655,6 +2684,22 @@ var FileSystemWriterUIActions = actions.Actions({
'clean_target_dir', 'clean_target_dir',
], ],
}, },
'Current image': {
alias: 'image',
action: 'exportImage',
data: [
//'name',
'pattern',
'size',
'export_mode',
// XXX do we save virtual images???
//'include_virtual',
'base_path',
'target_dir',
//'clean_target_dir',
],
},
//*/
}, },
// //

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.12a",
"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",