mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d19b678b37
commit
d2a5e3c15e
@ -2693,13 +2693,12 @@ function(title, func){
|
||||
&& ([items, ...args] =
|
||||
arg_handler.call(this, undefined, items, ...args))
|
||||
// run...
|
||||
;(items instanceof Array ?
|
||||
return Promise.all(
|
||||
(items instanceof Array ?
|
||||
items
|
||||
: [items])
|
||||
.map(function(item){
|
||||
return func.call(that, item, ...args) })
|
||||
// XXX should we return anything in sync mode???
|
||||
return Promise.resolve()
|
||||
return func.call(that, item, ...args) }))
|
||||
|
||||
// queue mode...
|
||||
} else {
|
||||
|
||||
@ -57,13 +57,13 @@ var IndexFormatActions = actions.Actions({
|
||||
|
||||
// XXX should these be 'p' or 'px' (current)???
|
||||
'preview-sizes': [
|
||||
75,
|
||||
200,
|
||||
//75,
|
||||
//200,
|
||||
480,
|
||||
900,
|
||||
//900,
|
||||
1080,
|
||||
1440,
|
||||
2160,
|
||||
//1440,
|
||||
//2160,
|
||||
],
|
||||
'preview-sizes-priority': [
|
||||
75,
|
||||
|
||||
@ -470,38 +470,34 @@ var SharpActions = actions.Actions({
|
||||
|| img.base_path
|
||||
|| this.location.path
|
||||
|
||||
return sizes
|
||||
.map(function(size, i){
|
||||
var name = path = path_tpl
|
||||
.replace(/\$RESOLUTION|\$\{RESOLUTION\}/g, parseInt(size))
|
||||
.replace(/\$GID|\$\{GID\}/g, gid)
|
||||
.replace(/\$NAME|\$\{NAME\}/g, img.name)
|
||||
// NOTE: we are 'sync' here for several reasons, mainly because
|
||||
// this is a small list and in this way we can take
|
||||
// advantage of OS file caching, and removing the queue
|
||||
// overhead, though small makes this noticeably faster...
|
||||
return that.makeResizedImage('sync', gid, size, base, {
|
||||
name,
|
||||
skipSmaller: true,
|
||||
transform: false,
|
||||
logger: logger_mode == 'gids' ?
|
||||
false
|
||||
: logger,
|
||||
})
|
||||
// XXX handle errors -- rejected because image exists...
|
||||
.then(function(res){
|
||||
// did not create a preview...
|
||||
if(!res){
|
||||
return false }
|
||||
|
||||
// update metadata...
|
||||
if(!base_path){
|
||||
var preview = img.preview = img.preview || {}
|
||||
preview[parseInt(size) + 'px'] = name
|
||||
that.markChanged
|
||||
&& that.markChanged('images', [gid]) }
|
||||
|
||||
return [gid, size, name] }) }) })],
|
||||
return Promise.all(
|
||||
sizes
|
||||
.map(function(size, i){
|
||||
var name = path = path_tpl
|
||||
.replace(/\$RESOLUTION|\$\{RESOLUTION\}/g, parseInt(size))
|
||||
.replace(/\$GID|\$\{GID\}/g, gid)
|
||||
.replace(/\$NAME|\$\{NAME\}/g, img.name)
|
||||
// NOTE: we are 'sync' here for several reasons, mainly because
|
||||
// this is a small list and in this way we can take
|
||||
// advantage of OS file caching, and removing the queue
|
||||
// overhead, though small makes this noticeably faster...
|
||||
return that.makeResizedImage('sync', gid, size, base, {
|
||||
name,
|
||||
skipSmaller: true,
|
||||
transform: false,
|
||||
logger: logger_mode == 'gids' ?
|
||||
false
|
||||
: logger,
|
||||
})
|
||||
// XXX handle errors -- rejected because image exists...
|
||||
.then(function(res){
|
||||
// update metadata...
|
||||
if(!base_path){
|
||||
var preview = img.preview = img.preview || {}
|
||||
preview[parseInt(size) + 'px'] = name
|
||||
that.markChanged
|
||||
&& that.markChanged('images', [gid]) }
|
||||
return [gid, size, name] }) })) })],
|
||||
|
||||
// XXX add support for offloading the processing to a thread/worker...
|
||||
// XXX revise logging and logger passing...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user