mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
Compare commits
3 Commits
26ce1512b2
...
a832589dcf
| Author | SHA1 | Date | |
|---|---|---|---|
| a832589dcf | |||
| 3f841c109a | |||
| 83623ac722 |
@ -1837,14 +1837,16 @@ var FileSystemWriterActions = actions.Actions({
|
||||
%(...)m - add text in braces if image marked
|
||||
%(...)b - add text in braces if image is bookmark
|
||||
|
||||
%(...)C - add text in braces if there are name conflicts.
|
||||
NOTE: this will be added to all images.
|
||||
%(...)c - add text in braces if there are name conflicts
|
||||
present, but only if the current image has a
|
||||
conflicting name.
|
||||
present in current index, but only if the current
|
||||
image has a conflicting name.
|
||||
%c - number in set of conflicting names (default: 0).
|
||||
NOTE: this is not stable and can change depending
|
||||
on image order.
|
||||
%(...)f - same as %{...}c but for conflitcs in output directory
|
||||
with pre-existing files.
|
||||
%f - same as %c but for conflicts in output directory with
|
||||
pre-existing files.
|
||||
|
||||
%(...)l - image level path, level depth corresponds to ribbon
|
||||
number counting from the bottom
|
||||
@ -1888,7 +1890,6 @@ var FileSystemWriterActions = actions.Actions({
|
||||
this.images[gid] || {},
|
||||
data)
|
||||
|
||||
|
||||
name = name
|
||||
|| pathlib.basename(
|
||||
data.path
|
||||
@ -1952,6 +1953,7 @@ var FileSystemWriterActions = actions.Actions({
|
||||
.replace(/%c/, (conflicts && conflicts[gid]) ?
|
||||
conflicts[gid].indexOf(gid)
|
||||
: 0)
|
||||
.replace(/%f/, data.number ?? 0)
|
||||
|
||||
// metadata...
|
||||
// XXX
|
||||
@ -1969,11 +1971,12 @@ var FileSystemWriterActions = actions.Actions({
|
||||
//.replace(
|
||||
// /%\(([^)]*)\)k/, tags.indexOf('bookmark') >= 0 ? '$1' : '')
|
||||
|
||||
// conflicts...
|
||||
.replace(
|
||||
/%\(([^)]*)\)C/, conflicts ? '$1' : '')
|
||||
// in conflicts...
|
||||
.replace(
|
||||
/%\(([^)]*)\)c/, (conflicts || {})[gid] ? '$1' : '')
|
||||
// out conflicts...
|
||||
.replace(
|
||||
/%\(([^)]*)\)f/, data.number > 0 ? '$1' : '')
|
||||
|
||||
// level...
|
||||
.replace(
|
||||
@ -1990,6 +1993,22 @@ var FileSystemWriterActions = actions.Actions({
|
||||
+(match.length + offset == str.length ? '' : '/') })
|
||||
|
||||
+ to_ext }],
|
||||
formatImageNameIter: ['- File/Format image filename (iter)',
|
||||
core.doc`Same as .formatImageName(..) but returns an iterator advancing
|
||||
the %f value.
|
||||
|
||||
data.number sets the initial count for %f
|
||||
|
||||
`,
|
||||
function*(format, name, data){
|
||||
var n = data.number ?? 0
|
||||
var prev, cur
|
||||
while(true){
|
||||
cur = this.formatImageName(format, name, {__proto__: data, number: n++})
|
||||
if(cur == prev){
|
||||
break }
|
||||
yield cur
|
||||
prev = cur } }],
|
||||
|
||||
|
||||
// XXX should this be sync???
|
||||
@ -2919,9 +2938,9 @@ var FileSystemWriterUIActions = actions.Actions({
|
||||
|
||||
// show example generated names...
|
||||
make(['Filename:',
|
||||
function(){ return actions.formatImageName(pattern, img) }],
|
||||
{
|
||||
open: function(){
|
||||
function(){
|
||||
return actions.formatImageName(pattern, img) }],
|
||||
{ open: function(){
|
||||
showExaples(settings['preview-name-pattern']
|
||||
|| EXPORT_PREVIEW_NAME) }, })
|
||||
|
||||
|
||||
@ -6,19 +6,23 @@
|
||||
|
||||
|
||||
FPS=${FPS:-8}
|
||||
if [ $1 == "-r" ] ; then
|
||||
FPS=$2
|
||||
if [ "$1" == "-r" ] ; then
|
||||
FPS="$2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
if ! [ -z "$1" ] ; then
|
||||
PATTERN="$1"
|
||||
else
|
||||
PATTERN=${PATTERN:-'*.jpg'}
|
||||
fi
|
||||
|
||||
LST=($PATTERN)
|
||||
|
||||
# generate name...
|
||||
LST=($PATTERN)
|
||||
A=${LST[0]}
|
||||
A=${A%.jpg}
|
||||
A=${A%.*}
|
||||
B=${LST[$(( ${#LST[@]} - 1 ))]}
|
||||
B=${B%.jpg}
|
||||
B=${B%.*}
|
||||
|
||||
NAME=${NAME:-${A}-${B}}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user