piwigo-bootstrap-darkroom icon indicating copy to clipboard operation
piwigo-bootstrap-darkroom copied to clipboard

More zoom

Open RStoroy opened this issue 2 years ago • 2 comments

How do I modfy the code to have more zoom in fullscreen mode with photoswipe?

RStoroy avatar Apr 25 '22 01:04 RStoroy

_photoswipe_js.tpl

    photoSwipe.listen('gettingData', function(index, item) {
        if(!item.is_video) {
          if( useLargeImages ) {
              item.src = item.xlargeImage.src;
              item.w = item.xlargeImage.w * 2;
              item.h = item.xlargeImage.h * 2;
              item.title = item.xlargeImage.title;
          } else {
              item.src = item.largeImage.src;
              item.w = item.largeImage.w * 2;
              item.h = item.largeImage.h * 2;
              item.title = item.largeImage.title;
          }

/* my upscale changes beginning / if ((item.w < photoSwipe.viewportSize.x) && (item.h < photoSwipe.viewportSize.y)){ / only upscale too small images */

    /* calculate factor which results in an image size > viewport size (round up to next integer for integer values) */
    factor_width = Math.ceil(photoSwipe.viewportSize.x / item.w);
    factor_height = Math.ceil(photoSwipe.viewportSize.y / item.h);
   
    use_factor = Math.min(factor_width, factor_height); /* use smallest possible factor (one side bigger than viewport is enough) */
    item.w *= use_factor;
    item.h *= use_factor;
    }
    /* my upscale changes end */

RStoroy avatar May 04 '22 18:05 RStoroy

Or at least allow the browser zoom. Currently that's not allowed in firefox. On mobile you can zoom in though.

fwsmit avatar Aug 23 '22 10:08 fwsmit