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

Allow direct linking of photos with PhotoSwipe enabled

Open sebageek opened this issue 2 years ago • 4 comments

I would like to be able to share a direct link to a photo when the thumbnail link is set to "PhotoSwipe slideshow".

When clicking on a link (with the "PhotoSwipe slideshow" setting) I can browse the photos and see that the URL changes for each photo (I see a &gid=1&pid=2 in the URL). I think it would be nice if I could give that link to a friend and they could see the photo I'm seeing (people looking at my gallery often use this link to talk about a specific photo to me). As the URL already has all the necessary information, we could just parse out the pid=x image, substract one (as pid is 1-based in the url, but the photo enumeration is 0-based) and start the PhotoSwipe with it.

sebageek avatar Apr 19 '22 21:04 sebageek

I gave a try to your pull-request. It doesn't work. When I copy paste a photoswipe URL, it simply doesn't open photoswipe :-/

plegall avatar Apr 21 '22 09:04 plegall

Hey, thanks for looking into this. I saw a release was already made with the proposed change. I updated the theme in my piwigo instance to 2.5.5 (overriding my local changes in the theme) and it still seems to work for me.

As an example, here is a directly-linked picture of a seagull standing in grass: https://photos.seba-geek.de/index/category/15#&gid=1&pid=2

Opening this in firefox in private mode (to make sure I'm not logged in or anything) first opens the image overview and then immediately acts like I clicked on the thumbnail of said picture. Does this work for you with my instance? Do you have an instance of piwigo I could take a look at?

This might also be related to the plugins I have installed alongside, maybe one of these is the culprit:

  • automatic size
  • exif view
  • GThumb+
  • RV Thumb Scroller
  • VideoJS
  • add tags mass
  • sharealbum
  • smartalbum

sebageek avatar Apr 21 '22 17:04 sebageek

It works for me on all tested desktop browsers, but I can reproduce it with my smartphone browser (firefox; a friend tested chrome as well). Did you test this with a smartphone as well? Peculiarly it seems to work on my desktop's firefox with "mobile view" enabled in developer tools.

sebageek avatar Apr 22 '22 16:04 sebageek

Okay, after a fair share of trying to debug this in my gallery I figured out that my problem was that the default theme on mobile was SmartPocket. Disabling all other themes made the direct links work on mobile as well (I bet there is another way to solve it, but I don't need the other themes anyway).

So I can't reproduce it (except when choosing the wrong theme). @plegall can you maybe describe your issue a bit more or help us reproduce it?

sebageek avatar Apr 26 '22 22:04 sebageek