mirror of
https://github.com/flynx/ImageGrid.git
synced 2026-01-02 00:11:08 +00:00
some polishing of exporting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bb413be06b
commit
b9c22d7781
19
ui/files.js
19
ui/files.js
@ -557,6 +557,9 @@ function updateRibbonsFromFavDirs(){
|
|||||||
|
|
||||||
// Export current state to directory...
|
// Export current state to directory...
|
||||||
//
|
//
|
||||||
|
// XXX this copies the files in parallel, make it sync and sequential...
|
||||||
|
// ...reason is simple, if we stop the copy we need to end up with
|
||||||
|
// part of the files copied full rather than all partially...
|
||||||
function exportTo(path, im_name, dir_name, size){
|
function exportTo(path, im_name, dir_name, size){
|
||||||
path = path == null ? BASE_URL : path
|
path = path == null ? BASE_URL : path
|
||||||
im_name = im_name == null ? '%f' : im_name
|
im_name = im_name == null ? '%f' : im_name
|
||||||
@ -570,7 +573,16 @@ function exportTo(path, im_name, dir_name, size){
|
|||||||
path = normalizePath(path)
|
path = normalizePath(path)
|
||||||
|
|
||||||
var order = DATA.order
|
var order = DATA.order
|
||||||
var z = (('10e' + (order.length + '').length) * 1 + '').slice(2)
|
var Z = (('10e' + (order.length + '').length) * 1 + '').slice(2)
|
||||||
|
|
||||||
|
// mainly used for file naming, gives us ability to number images
|
||||||
|
// in the current selection...
|
||||||
|
var selection = []
|
||||||
|
$.each(DATA.ribbons, function(_, e){
|
||||||
|
selection = selection.concat(e)
|
||||||
|
})
|
||||||
|
selection.sort(imageOrderCmp)
|
||||||
|
var z = (('10e' + (selection.length + '').length) * 1 + '').slice(2)
|
||||||
|
|
||||||
// go through ribbons...
|
// go through ribbons...
|
||||||
for(var i=DATA.ribbons.length-1; i >= 0; i--){
|
for(var i=DATA.ribbons.length-1; i >= 0; i--){
|
||||||
@ -593,8 +605,11 @@ function exportTo(path, im_name, dir_name, size){
|
|||||||
// gid...
|
// gid...
|
||||||
dest = dest.replace('%gid', gid)
|
dest = dest.replace('%gid', gid)
|
||||||
dest = dest.replace('%g', gid.slice(34))
|
dest = dest.replace('%g', gid.slice(34))
|
||||||
// order...
|
// global order...
|
||||||
var o = order.indexOf(gid) + ''
|
var o = order.indexOf(gid) + ''
|
||||||
|
dest = dest.replace('%I', (Z + o).slice(o.length))
|
||||||
|
//
|
||||||
|
var o = selection.indexOf(gid) + ''
|
||||||
dest = dest.replace('%i', (z + o).slice(o.length))
|
dest = dest.replace('%i', (z + o).slice(o.length))
|
||||||
// XXX Metadata...
|
// XXX Metadata...
|
||||||
// XXX
|
// XXX
|
||||||
|
|||||||
3
ui/ui.js
3
ui/ui.js
@ -728,7 +728,8 @@ function exportPreviewsDialog(state, dfl){
|
|||||||
'%e - extension\n'+
|
'%e - extension\n'+
|
||||||
'%gid - log gid\n'+
|
'%gid - log gid\n'+
|
||||||
'%g - short gid\n'+
|
'%g - short gid\n'+
|
||||||
'%i - order'] = '%f'
|
'%I - global order\n'+
|
||||||
|
'%i - current selection order'] = '%f'
|
||||||
cfg['Fav directory name'] = 'fav'
|
cfg['Fav directory name'] = 'fav'
|
||||||
cfg['Destination'] = {ndir: dfl}
|
cfg['Destination'] = {ndir: dfl}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user