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
// intentionally to avoid the previews MAC computers
// 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-skip-previews': false,
@ -247,6 +248,16 @@ var FileSystemLoaderActions = actions.Actions({
'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 need a more generic form...
checkPath: ['- File/',
@ -501,7 +512,7 @@ var FileSystemLoaderActions = actions.Actions({
// get the image list...
return new Promise(function(resolve, reject){
var files = {}
glob.globStream(path + '/'+ that.config['image-file-pattern'], {
glob.globStream(path +'/'+ that.imageFilePattern, {
stat: !!read_stat,
withFileTypes: true,
strict: false,
@ -1153,7 +1164,7 @@ var FileSystemLoaderUIActions = actions.Actions({
var o = browseWalk.makeWalk(null,
base,
this.config['image-file-pattern'],
this.imageFilePattern,
cfg)
// path selected...
.open(function(evt, path){

View File

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