• Chris

    (@chrisbegley)


    Hello,

    Thank you for creating the best PhotoSwipe plugin for WordPress!

    I have a feature request… I have a lot of hi-res images on my website. Some of them are 10MB in size. This causes the images to load slowly in Photoswipe.

    I’d love to see an option where we can choose a pre-defined WordPress image size (Medium, Large, etc.) to open with Photoswipe so that the images load faster. Then, users can click the “Download Image” link from the Share menu to download the full sized image and view it in hi-res at 10MB.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    I understand your problem – however this is not that easy since this would also need to change the URLs in the links itself and the image sizes are not fixed. So there is no rule what “medium” or “large” is – it depends on the image itself. Only WordPress knows, what sizes it generated. Besides that PhotoSwipe itself would also need to be changed as it only supports one single URL for each image and not a smaller “display” version and a larger “download” version.

    For example:

    If you have a link like <a href="wp-content/uploads/2021/04/image.jpg"> this link need to be changed to <a href="wp-content/uploads/2021/04/image-WIDTHxHEIGHT.jpg"> – however: WIDTH and HEIGHT are not fixed values but depend on the real size of the image. One image might be 768×775 while another image on the same site is 640×1138. In fact the plugin would need to scan the upload folder for existing image sizes and “guess” what version is “large” or “medium”. This could slow down things significantly so additional caching techniques are needed to avoid delays for the page rendering.

    So I am not sure if this can be done at all. But I added a Github issue for it: https://github.com/arnowelzel/lightbox-photoswipe/issues/78

    Thread Starter Chris

    (@chrisbegley)

    Thanks for that explanation!

    I do use JetPack CDN, so perhaps this feature could be used with that? Since you can change the size with a parameter.

    For example…

    wp-content/uploads/2021/04/image.jpg could be changed to wp-content/uploads/2021/04/image.jpg?w=1024 if it’s being served from the JetPack CDN. Maybe there can be a setting where we enter the size (like 1024px).

    Although I don’t know if that solves the bigger issues that you mentioned:

    Besides that PhotoSwipe itself would also need to be changed as it only supports one single URL for each image and not a smaller “display” version and a larger “download” version.

    But maybe the “Custom link, URL” feature would work there with {{raw_image_url}}

    • This reply was modified 3 years, 10 months ago by Chris.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Option to load custom image size instead of “full”?’ is closed to new replies.