mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
lots of tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
933b763944
commit
e6243fdd3e
@ -55,7 +55,7 @@ var IndexFormatActions = actions.Actions({
|
|||||||
config: {
|
config: {
|
||||||
'index-dir': '.ImageGrid',
|
'index-dir': '.ImageGrid',
|
||||||
|
|
||||||
// XXX should these be 'p' or 'px' (current)...
|
// XXX should these be 'p' or 'px' (current)???
|
||||||
'preview-sizes': [
|
'preview-sizes': [
|
||||||
75,
|
75,
|
||||||
200,
|
200,
|
||||||
@ -65,6 +65,11 @@ var IndexFormatActions = actions.Actions({
|
|||||||
1440,
|
1440,
|
||||||
2160,
|
2160,
|
||||||
],
|
],
|
||||||
|
'preview-sizes-priority': [
|
||||||
|
75,
|
||||||
|
200,
|
||||||
|
1080,
|
||||||
|
],
|
||||||
|
|
||||||
// Supported fields:
|
// Supported fields:
|
||||||
// $INDEX - index directory name
|
// $INDEX - index directory name
|
||||||
|
|||||||
@ -466,6 +466,14 @@ var SharpActions = actions.Actions({
|
|||||||
var loaded = this.ribbons
|
var loaded = this.ribbons
|
||||||
&& new Set(this.ribbons.getImageGIDs())
|
&& new Set(this.ribbons.getImageGIDs())
|
||||||
|
|
||||||
|
/*/ XXX set this to tmp for .location.load =='loadImages'
|
||||||
|
var base_path = that.location.load == 'loadIndex' ?
|
||||||
|
null
|
||||||
|
: tmp
|
||||||
|
/*/
|
||||||
|
var base_path
|
||||||
|
//*/
|
||||||
|
|
||||||
return images
|
return images
|
||||||
.mapChunks(function(gid){
|
.mapChunks(function(gid){
|
||||||
return sharp(that.getImagePath(gid))
|
return sharp(that.getImagePath(gid))
|
||||||
@ -485,17 +493,19 @@ var SharpActions = actions.Actions({
|
|||||||
img.orientation = o.orientation || 0
|
img.orientation = o.orientation || 0
|
||||||
img.flipped = o.flipped
|
img.flipped = o.flipped
|
||||||
|
|
||||||
/* XXX should generate previews in a temp dir or as data-urls...
|
|
||||||
// if image too large, generate preview(s)...
|
// if image too large, generate preview(s)...
|
||||||
var size_threshold = that.config['preview-generate-threshold']
|
var size_threshold = that.config['preview-generate-threshold']
|
||||||
if(size_threshold
|
if(size_threshold
|
||||||
|
&& img.preview == null
|
||||||
&& Math.max(metadata.width, metadata.height) > size_threshold){
|
&& Math.max(metadata.width, metadata.height) > size_threshold){
|
||||||
logger && logger.emit('Image too large', gid)
|
logger && logger.emit('Image too large', gid)
|
||||||
// XXX might be a good idea to only generate
|
// XXX make this more generic...
|
||||||
// a single preview...
|
// ...if 'loadImages' should create previews in tmp...
|
||||||
// XXX
|
that.location.load == 'loadIndex'
|
||||||
this.makePreviews(gid) }
|
&& that.makePreviews(gid,
|
||||||
//*/
|
that.config['preview-sizes-priority'] || 1080,
|
||||||
|
base_path,
|
||||||
|
logger) }
|
||||||
|
|
||||||
// XXX EXIF -- keep compatible with exiftool...
|
// XXX EXIF -- keep compatible with exiftool...
|
||||||
// - dates
|
// - dates
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user