Compare commits

...

2 Commits

Author SHA1 Message Date
e1e4324f90 minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-08-26 10:39:52 +03:00
bb3f3f2ea0 added gif support...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-08-26 10:22:33 +03:00
2 changed files with 16 additions and 5 deletions

View File

@ -239,7 +239,8 @@ var FileSystemLoaderActions = actions.Actions({
// NOTE: this will not match "dot filenames", this is done // NOTE: this will not match "dot filenames", this is done
// intentionally to avoid the previews MAC computers // intentionally to avoid the previews MAC computers
// generate all over the place... // generate all over the place...
'image-file-pattern': '*.@(jpg|jpeg|png|svg|JPG|JPEG|PNG|SVG)', // XXX make the pattern case-agnostic (see .imageFilePattern)
'image-file-pattern': '*.@(jpg|jpeg|png|svg|gif)',
'image-file-read-stat': true, 'image-file-read-stat': true,
'image-file-skip-previews': false, 'image-file-skip-previews': false,
@ -247,6 +248,16 @@ var FileSystemLoaderActions = actions.Actions({
'default-load-method': 'loadIndex', 'default-load-method': 'loadIndex',
}, },
// NOTE: this is not called too often thus there is not need to cache...
get imageFilePattern(){
return this.config['image-file-pattern']
.replace(/([a-z]+)/g,
function(e){
return e +'|'+ e.toUpperCase() }) },
set imageFilePattern(value){
this.config['image-file-pattern'] = value },
// XXX is this a hack??? // XXX is this a hack???
// XXX need a more generic form... // XXX need a more generic form...
checkPath: ['- File/', checkPath: ['- File/',
@ -501,7 +512,7 @@ var FileSystemLoaderActions = actions.Actions({
// get the image list... // get the image list...
return new Promise(function(resolve, reject){ return new Promise(function(resolve, reject){
var files = {} var files = {}
glob.globStream(path + '/'+ that.config['image-file-pattern'], { glob.globStream(path +'/'+ that.imageFilePattern, {
stat: !!read_stat, stat: !!read_stat,
withFileTypes: true, withFileTypes: true,
strict: false, strict: false,
@ -1153,7 +1164,7 @@ var FileSystemLoaderUIActions = actions.Actions({
var o = browseWalk.makeWalk(null, var o = browseWalk.makeWalk(null,
base, base,
this.config['image-file-pattern'], this.imageFilePattern,
cfg) cfg)
// path selected... // path selected...
.open(function(evt, path){ .open(function(evt, path){

View File

@ -1,12 +1,12 @@
{ {
"name": "ImageGrid.Viewer.g4", "name": "ImageGrid.Viewer.g4",
"version": "4.0.10a", "version": "4.0.11a",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ImageGrid.Viewer.g4", "name": "ImageGrid.Viewer.g4",
"version": "4.0.10a", "version": "4.0.11a",
"dependencies": { "dependencies": {
"app-module-path": "*", "app-module-path": "*",
"async-json": "0.0.2", "async-json": "0.0.2",