Announcement

  •  » Extensions
  •  » GThumb+ - infinite recursion

#1 2024-08-24 12:27:48

vuk
Member
2018-09-05
9

GThumb+ - infinite recursion

Hello

I'm using piwigo 14.5.0 with Bootstrap Darkroom and GThumb+.
Found than the GThumb+ sometimes goes into infinite recursion when recalculating thumbnail grid.
As far as i understand it happens depending on the page size in pixels, but i have not found the exact reason.
I'm not a JS programmer, but I tried to fix this problem.

Changes in gthumb.js i made to avoid infinite recursion:

Code:

  build: function () {
...
    GThumb.process(2);
  },

  process: function(max_recursion) { //<- add new parameter 

    var width_count = GThumb.margin;
    var line = 1;
    var round_rest = 0;
    var main_width = jQuery('#thumbnails').width();
    var first_thumb = jQuery('#thumbnails img.thumbnail:first');
    var best_size = {width:1,height:1};

    if(max_recursion <= 0) return;//<- verify value

....

    if (main_width != jQuery('#thumbnails').width()) {
      GThumb.process(max_recursion - 1);//<- decrease max_recursion when making recursive call
    }
  },

Offline

 

#2 2024-10-08 01:19:40

rajdude
Member
2021-05-18
97

Re: GThumb+ - infinite recursion

Yup, for me also that plugin was not working properly after the recent upgrades.

I switched to this :

gdThumb

It works perfectly fine for generating thumbnails. I have generated over 300 in one go, it just works.

Offline

 
  •  » Extensions
  •  » GThumb+ - infinite recursion

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact