mirror of
https://github.com/flynx/ImageGrid.git
synced 2026-01-07 02:41:08 +00:00
located and fixed (I hope) several pahntom bugs (see todo for details)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
140ba153ae
commit
bf561c9fa4
26
ui/TODO.otl
26
ui/TODO.otl
@ -108,14 +108,17 @@ Roadmap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
[_] 28% Gen 3 current todo
|
[_] 30% Gen 3 current todo
|
||||||
[_] 56% High priority
|
[_] 60% High priority
|
||||||
[_] BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading...
|
[X] BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading...
|
||||||
| problem likely in loadImagesAround(...)
|
| problem likely in loadImagesAround(...)
|
||||||
|
|
|
|
||||||
| ribbon length 178 also ends up messing things up, while 68 and
|
| - ribbon length 178 also ends up messing things up, while 68 and
|
||||||
| 69 pose no problems...
|
| 69 pose no problems...
|
||||||
[_] BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
| - 19 images @ 5 per ribbon also breaks things...
|
||||||
|
|
|
||||||
|
| was a bug in rollImages(...)
|
||||||
|
[X] BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
||||||
| this happens when updating/adding lots of elements:
|
| this happens when updating/adding lots of elements:
|
||||||
|
|
|
|
||||||
| the update code is done and returns BEFORE the browser is done
|
| the update code is done and returns BEFORE the browser is done
|
||||||
@ -123,6 +126,9 @@ Roadmap
|
|||||||
|
|
|
|
||||||
| one of the side-effects is that the updates or added elements
|
| one of the side-effects is that the updates or added elements
|
||||||
| do not yet exist when the code is done and returned.
|
| do not yet exist when the code is done and returned.
|
||||||
|
|
|
||||||
|
| XXX I do not know why or how but this appears to have gotten fixed
|
||||||
|
| by rewriting loadImages(...) to loadImagesAround(...)
|
||||||
[X] BUG: reloadViewer(...) loses image focus...
|
[X] BUG: reloadViewer(...) loses image focus...
|
||||||
| ...if the image is not near ribbon start.
|
| ...if the image is not near ribbon start.
|
||||||
|
|
|
|
||||||
@ -156,7 +162,7 @@ Roadmap
|
|||||||
|
|
|
|
||||||
| XXX possibly related to
|
| XXX possibly related to
|
||||||
| BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
| BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
||||||
[_] BUG: jumping in ribbon sometimes does not load the ribbon correctly...
|
[X] BUG: jumping in ribbon sometimes does not load the ribbon correctly...
|
||||||
| Example 1:
|
| Example 1:
|
||||||
| first ribbon in (loaded at first image):
|
| first ribbon in (loaded at first image):
|
||||||
| "F:\work\ImageGrid\cur\ImageGrid\src\ui\BUGS\ribbon loading error\"
|
| "F:\work\ImageGrid\cur\ImageGrid\src\ui\BUGS\ribbon loading error\"
|
||||||
@ -180,9 +186,11 @@ Roadmap
|
|||||||
|
|
|
|
||||||
| XXX possibly related to
|
| XXX possibly related to
|
||||||
| BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
| BUG CLASS (ASAP!): race conditions due to browser rendering lag...
|
||||||
|
|
|
||||||
|
| Appears to be fixed...
|
||||||
[_] OSX: add alternatives to function buttons...
|
[_] OSX: add alternatives to function buttons...
|
||||||
[_] BUG: OSX: unable to load absolute paths...
|
[_] BUG: OSX: unable to load absolute paths...
|
||||||
[_] BUG: when loading and a non-existing dir, opening a new dir raises an error
|
[_] BUG: when loading a non-existing dir, opening a new dir raises an error
|
||||||
| i.e. the open dialog does not close, while the images are loaded...
|
| i.e. the open dialog does not close, while the images are loaded...
|
||||||
[_] Q: how do we mark unsorted sections in base ribbon after aligning?
|
[_] Q: how do we mark unsorted sections in base ribbon after aligning?
|
||||||
| - there is a big gap in the ribbon below, but it's not visible...
|
| - there is a big gap in the ribbon below, but it's not visible...
|
||||||
@ -316,7 +324,7 @@ Roadmap
|
|||||||
| centerView() fixes this, but only for the current image...
|
| centerView() fixes this, but only for the current image...
|
||||||
[_] BUG: sometimes images.json folder is created...
|
[_] BUG: sometimes images.json folder is created...
|
||||||
| can't repeat this yet, and seen only once...
|
| can't repeat this yet, and seen only once...
|
||||||
[_] BUG: cropping in single image mode will change image scale...
|
[X] BUG: cropping in single image mode will change image scale...
|
||||||
| likely a problem with reloadViewer(...)
|
| likely a problem with reloadViewer(...)
|
||||||
[_] 0% full archive index
|
[_] 0% full archive index
|
||||||
[_] segmented loading of images and data
|
[_] segmented loading of images and data
|
||||||
|
|||||||
27
ui/data.js
27
ui/data.js
@ -1180,6 +1180,15 @@ function updateImage(image, gid, size){
|
|||||||
img_data = STUB_IMAGE_DATA
|
img_data = STUB_IMAGE_DATA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// set the current class...
|
||||||
|
if(gid == DATA.current){
|
||||||
|
image.addClass('current')
|
||||||
|
} else {
|
||||||
|
image.removeClass('current')
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// preview...
|
// preview...
|
||||||
var p_url = getBestPreview(gid, size).url
|
var p_url = getBestPreview(gid, size).url
|
||||||
// NOTE: due to the fact that loading/caching the image might be at
|
// NOTE: due to the fact that loading/caching the image might be at
|
||||||
@ -1421,7 +1430,7 @@ function loadImagesAround(count, gid, ribbon, data){
|
|||||||
// no common sections, do a full reload...
|
// no common sections, do a full reload...
|
||||||
//if(left == null && right == null){
|
//if(left == null && right == null){
|
||||||
if(left == null || right == null){
|
if(left == null || right == null){
|
||||||
console.log('Ribbon #'+ribbon+', reloading...')
|
//console.log('Ribbon #'+ribbon+', reloading...')
|
||||||
|
|
||||||
var n = new_ribbon.indexOf(gid)
|
var n = new_ribbon.indexOf(gid)
|
||||||
var o = old_ribbon.indexOf(gid)
|
var o = old_ribbon.indexOf(gid)
|
||||||
@ -1431,11 +1440,13 @@ function loadImagesAround(count, gid, ribbon, data){
|
|||||||
var left = n - o
|
var left = n - o
|
||||||
var right = (new_ribbon.length - old_ribbon.length) - left
|
var right = (new_ribbon.length - old_ribbon.length) - left
|
||||||
|
|
||||||
|
/*
|
||||||
console.log(' >>>', left, right, '---',
|
console.log(' >>>', left, right, '---',
|
||||||
'old:', old_ribbon.length,
|
'old:', old_ribbon.length,
|
||||||
'@', o,
|
'@', o,
|
||||||
'new:', new_ribbon.length,
|
'new:', new_ribbon.length,
|
||||||
'@', n)
|
'@', n)
|
||||||
|
*/
|
||||||
|
|
||||||
extendRibbon(left, right, ribbon_elem)
|
extendRibbon(left, right, ribbon_elem)
|
||||||
|
|
||||||
@ -1450,17 +1461,21 @@ function loadImagesAround(count, gid, ribbon, data){
|
|||||||
// XXX buggy...
|
// XXX buggy...
|
||||||
// see: BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading...
|
// see: BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading...
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
console.log('Ribbon #'+ribbon+', updating...')
|
console.log('Ribbon #'+ribbon+', updating...')
|
||||||
console.log(' >>>', left, right, '---',
|
console.log(' >>>', left, right, '---',
|
||||||
'old:', old_ribbon.length,
|
'old:', old_ribbon.length,
|
||||||
'@', old_ribbon.indexOf(gid),
|
'@', old_ribbon.indexOf(gid),
|
||||||
'new:', new_ribbon.length,
|
'new:', new_ribbon.length,
|
||||||
'@', new_ribbon.indexOf(gid))
|
'@', new_ribbon.indexOf(gid))
|
||||||
|
*/
|
||||||
|
|
||||||
var res = extendRibbon(left, right, ribbon_elem)
|
var res = extendRibbon(left, right, ribbon_elem)
|
||||||
// XXX this will get all the current images, not the resulting ones...
|
// XXX this will get all the current images, not the resulting ones...
|
||||||
var images = ribbon_elem.find('.image')
|
var images = ribbon_elem.find('.image')
|
||||||
|
|
||||||
|
//console.log(' >>> images:', images.length, 'res:', res.left.length, res.right.length)
|
||||||
|
|
||||||
var updated = 0
|
var updated = 0
|
||||||
|
|
||||||
// update the images...
|
// update the images...
|
||||||
@ -1617,16 +1632,18 @@ function rollImages(n, ribbon, extend, no_compensate_shift){
|
|||||||
if(gids.length == 0){
|
if(gids.length == 0){
|
||||||
return $([])
|
return $([])
|
||||||
}
|
}
|
||||||
|
var l = gids.length
|
||||||
// truncate the results to the length of images...
|
// truncate the results to the length of images...
|
||||||
if(n > images.length){
|
if(n > 0 && l > images.length){
|
||||||
gids.reverse().splice(images.length)
|
gids.reverse().splice(images.length)
|
||||||
gids.reverse()
|
gids.reverse()
|
||||||
} else if(Math.abs(n) > images.length){
|
} else if(l > images.length){
|
||||||
gids.splice(images.length)
|
gids.splice(images.length)
|
||||||
}
|
}
|
||||||
|
l = gids.length
|
||||||
|
|
||||||
if(n < images.length){
|
if(l < images.length){
|
||||||
images = rollRibbon(gids.length * (n > 0 ? 1 : -1), ribbon, extend, no_compensate_shift)
|
images = rollRibbon(l * (n > 0 ? 1 : -1), ribbon, extend, no_compensate_shift)
|
||||||
}
|
}
|
||||||
|
|
||||||
var size = getVisibleImageSize('max')
|
var size = getVisibleImageSize('max')
|
||||||
|
|||||||
@ -757,6 +757,7 @@ function prevScreenImages(){
|
|||||||
function firstImage(){
|
function firstImage(){
|
||||||
$('.viewer').trigger('requestedFirstImage', [getRibbon()])
|
$('.viewer').trigger('requestedFirstImage', [getRibbon()])
|
||||||
|
|
||||||
|
// if we are already there, flash the indicator...
|
||||||
if(getImage().prevAll('.image').length == 0){
|
if(getImage().prevAll('.image').length == 0){
|
||||||
flashIndicator('start')
|
flashIndicator('start')
|
||||||
}
|
}
|
||||||
@ -768,6 +769,7 @@ function firstImage(){
|
|||||||
function lastImage(){
|
function lastImage(){
|
||||||
$('.viewer').trigger('requestedLastImage', [getRibbon()])
|
$('.viewer').trigger('requestedLastImage', [getRibbon()])
|
||||||
|
|
||||||
|
// if we are already there, flash the indicator...
|
||||||
if(getImage().nextAll('.image').length == 0){
|
if(getImage().nextAll('.image').length == 0){
|
||||||
flashIndicator('end')
|
flashIndicator('end')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user