a bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-10-11 04:11:31 +03:00
parent 75b09823eb
commit 054c5a2d2e
4 changed files with 39 additions and 35 deletions

View File

@ -458,19 +458,16 @@ var DataPrototype = {
// //
// NOTE: only the first occurrence is kept... // NOTE: only the first occurrence is kept...
// NOTE: this is slow-ish... // NOTE: this is slow-ish...
removeDuplicates: function(lst, skip_undefined){ removeDuplicates: function(lst, skip_undefined=true){
skip_undefined = if(skip_undefined){
skip_undefined == null ?
true
: skip_undefined
var lst_idx = lst.toKeys() var lst_idx = lst.toKeys()
for(var i=0; i < lst.length; i++){ for(var i=lst.length-1; i >= 0 ; i--){
if(skip_undefined if(lst[i] == null){
&& lst[i] == null){
continue } continue }
if(lst_idx[lst[i]] != i){ if(lst_idx[lst[i]] != i){
lst.splice(i, 1) lst.splice(i, 1) } }
i -= 1 } } } else {
lst.splice(0, lst.length, ...(new Set(lst))) }
return lst }, return lst },
// List of sparse image set names... // List of sparse image set names...

View File

@ -151,14 +151,13 @@
} }
}, },
"node_modules/@electron/rebuild": { "node_modules/@electron/rebuild": {
"version": "4.0.1", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.0.1.tgz", "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.0.2.tgz",
"integrity": "sha512-iMGXb6Ib7H/Q3v+BKZJoETgF9g6KMNZVbsO4b7Dmpgb5qTFqyFTzqW9F3TOSHdybv2vKYKzSS9OiZL+dcJb+1Q==", "integrity": "sha512-8iZWVPvOpCdIc5Pj5udQV3PeO7liJVC7BBUSizl1HCfP7ZxYc9Kqz0c3PDNj2HQ5cQfJ5JaBeJIYKPjAvLn2Rg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@malept/cross-spawn-promise": "^2.0.0", "@malept/cross-spawn-promise": "^2.0.0",
"chalk": "^4.0.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"detect-libc": "^2.0.1", "detect-libc": "^2.0.1",
"got": "^11.7.0", "got": "^11.7.0",
@ -907,9 +906,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.19.1", "version": "22.19.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.3.tgz",
"integrity": "sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==", "integrity": "sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.21.0" "undici-types": "~6.21.0"
@ -1594,9 +1593,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron": { "node_modules/electron": {
"version": "37.10.2", "version": "37.10.3",
"resolved": "https://registry.npmjs.org/electron/-/electron-37.10.2.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-37.10.3.tgz",
"integrity": "sha512-7TOA9WVO8jFKvkWMJPkSmQxV68TJEPa8bh4AYykKYuUcsezxsbZUpEH8MgEHH/orJhpbaO77XIC/+40lMkTlEg==", "integrity": "sha512-3IjCGSjQmH50IbW2PFveaTzK+KwcFX9PEhE7KXb9v5IT8cLAiryAN7qezm/XzODhDRlLu0xKG1j8xWBtZ/bx/g==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -1710,9 +1709,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/exifreader": { "node_modules/exifreader": {
"version": "4.32.0", "version": "4.33.1",
"resolved": "https://registry.npmjs.org/exifreader/-/exifreader-4.32.0.tgz", "resolved": "https://registry.npmjs.org/exifreader/-/exifreader-4.33.1.tgz",
"integrity": "sha512-sj1PzjpaPwSE/2MeUqoAYcfc2u7AZOGSby0FzmAkB4jjeCXgDryxzVgMwV+tJKGIkGdWkkWiUWoLSJoPHJ6V5Q==", "integrity": "sha512-KsVc4bRfZW255PSst5Opt5jUeLp+SD2+q6fmXQkMMkphpFCDBFjzNAvswgQa1YcMrXq+9Na6HJ6gS3wo2x7RRw==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MPL-2.0", "license": "MPL-2.0",
"optionalDependencies": { "optionalDependencies": {
@ -2944,10 +2943,10 @@
} }
}, },
"node_modules/path-scurry/node_modules/lru-cache": { "node_modules/path-scurry/node_modules/lru-cache": {
"version": "11.2.2", "version": "11.2.4",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.4.tgz",
"integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", "integrity": "sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==",
"license": "ISC", "license": "BlueOak-1.0.0",
"engines": { "engines": {
"node": "20 || >=22" "node": "20 || >=22"
} }
@ -3091,9 +3090,9 @@
} }
}, },
"node_modules/requirejs": { "node_modules/requirejs": {
"version": "2.3.7", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.8.tgz",
"integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==", "integrity": "sha512-7/cTSLOdYkNBNJcDMWf+luFvMriVm7eYxp4BcFCsAX0wF421Vyce5SXP17c+Jd5otXKGNehIonFlyQXSowL6Mw==",
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"r_js": "bin/r.js", "r_js": "bin/r.js",

View File

@ -1,7 +1,7 @@
{ {
"name": "ImageGrid.Viewer.g4", "name": "ImageGrid.Viewer.g4",
"main": "index.html", "main": "index.html",
"version": "4.0.13a", "version": "4.0.14a",
"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",

View File

@ -17,6 +17,7 @@ FPS=${FPS:-8}
# XXX ffmpeg does not seem to support extglob... # XXX ffmpeg does not seem to support extglob...
#PATTERN=${PATTERN:-'*.@(JPG|jpg|JPEG|jpeg|PNG|png)'} #PATTERN=${PATTERN:-'*.@(JPG|jpg|JPEG|jpeg|PNG|png)'}
PATTERN=${PATTERN:-'*.jpeg'} PATTERN=${PATTERN:-'*.jpeg'}
ANIM_EXT=.gif
while [[ $# != 0 ]] ; do while [[ $# != 0 ]] ; do
case "$1" in case "$1" in
@ -28,6 +29,7 @@ while [[ $# != 0 ]] ; do
echo " -r --rate FPS - set framerate (default: $FPS)" echo " -r --rate FPS - set framerate (default: $FPS)"
echo " -p --pattern PATTERN" echo " -p --pattern PATTERN"
echo " - image pattern to use (default: '$PATTERN')" echo " - image pattern to use (default: '$PATTERN')"
echo " --apng - use .apng instead of .gif (experimental)"
echo echo
echo "NOTE: option defaults can bbe overriden by coresponding env variables." echo "NOTE: option defaults can bbe overriden by coresponding env variables."
echo echo
@ -43,6 +45,12 @@ while [[ $# != 0 ]] ; do
shift 2 shift 2
continue continue
;; ;;
--apng)
# XXX do we need to do the palette dance here???
ANIM_EXT=.apng
shift
continue
;;
# trailing args... # trailing args...
*) *)
@ -83,7 +91,7 @@ PALETTE=${PALETTE:-.palette.png}
-i $PATTERN \ -i $PATTERN \
-i "$PALETTE" \ -i "$PALETTE" \
-filter_complex paletteuse=dither=none \ -filter_complex paletteuse=dither=none \
"${NAME}".gif "${NAME}${ANIM_EXT}"
# cleanup... # cleanup...
@ rm "$PALETTE" @ rm "$PALETTE"