Is it possible to open the Images allways zoomed.? So the user has to click on (-) to fit the image?
Is ist possible to start with Desktop-Zoom?
For now there is no option to set start zoom level. But this feature is planned.
You can do this via API by executing zoomTo method after the initialization http://photoswipe.com/documentation/api.html
Though, you can't execute it on nearby images (as memory usage is increased up to 10 times when image is zoomed, which causes mobile browser to crash). Which is the main reason why it's not implemented yet.
But if you're using PhotoSwipe to zoom just one image at a time – zoomTo will work.
thx
@dimsemenov,
Do you have a recommendation for when to invoke zoomTo so that users never see a reduced size of the image?
Currently, I am attaching the zoomTo calls to beforeChange and afterChange:
var autoZoom = function() {
pswp.zoomTo(
pswp.currItem.fitRatio,
{ x: pswp.viewportSize.x/2, y: pswp.viewportSize.y/2 },
0
);
};
pswp.listen('beforeChange', autoZoom);
pswp.listen('afterChange', autoZoom);
However, when swiping left or right from the current slide, the image off screen scrolls into view at the reduced size before popping to the proper zoom (once afterChange fires).
@aaronransley, for now there is no option to apply zoom level not on the current item. And it's not possible to start all items "zoomed" without direct modifications of PhotoSwipe.
There are some problems regarding memory usage and performance of swipe, that aren't solvable for now without tiling. But I'm working on this problem.
@dimsemenov, thanks for the info. I'll look into possibly modifying the core of PhotoSwipe for this edge case. If I come up with anything worth sharing I'll submit a pull request.
Did anybody have luck with this?
+1
+1
+1
This will be implemented in the new version, a basic prototype is already ready. Memory usage issue is partly fixed.
@dimsemenov This is a really interesting feature and I will be happy to see it released to public soon, by the time, could you please share this feature with us on it's current state please ?
@farissi, here is example - http://codepen.io/dimsemenov/pen/jrpwEZ , just don't use it in production until the official release.
@dimsemenov The demo in the last comment you made appears to be broken. Assets are linking to /test/ directory on the PhotoSwipe website, which probably isn't there.
Has anyone managed to solve this? I have a single image 'gallery' I'd like to initialise as zoomed in from the start, but trying the example with zoomTo method does not work.
@michaelpumo I've had to change the source of the library to add a new zoom level which would respect the "initialZoomLevel" you could set on per item. You can see the change here: https://github.com/dimsemenov/PhotoSwipe/issues/1424
Having said that I'd love to have an option to do that automatically, like : defaultZoomFactor: 2 which would automatically open the image twice as its original size, for instance.
Did this ever get implemented?
zoomTo method after initialization causes some janky rendering and can't see the demo of using openZoomed anymore
so has this been implemented that it is closed now? or it will not be implemented?
Most helpful comment
@michaelpumo I've had to change the source of the library to add a new zoom level which would respect the "initialZoomLevel" you could set on per item. You can see the change here: https://github.com/dimsemenov/PhotoSwipe/issues/1424
Having said that I'd love to have an option to do that automatically, like : defaultZoomFactor: 2 which would automatically open the image twice as its original size, for instance.