Piwigo / piwigo-bootstrap-darkroom

A mobile-ready and feature-rich theme for Piwigo photo gallery, based on Bootstrap 4
Apache License 2.0
83 stars 40 forks source link

More zoom #320

Open RStoroy opened 2 years ago

RStoroy commented 2 years ago

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

RStoroy commented 2 years ago

_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 */
fwsmit commented 2 years ago

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