• Resolved bkpr

    (@bkpr)


    Note: post password is: bacon

    Hi. Testing Photonic as a gallery plugin to roll out over several sites. I’m having an issue where the filesize of the thumbnails (in mosaic or masonry layouts) is the same size as when clicked to go into the lightbox gallery (Lightgallery option). Here’s the code I’m using which is generated by the plugin:

    [gallery type='default' style='masonry' caption='desc' columns='3' thumbnail_size='thumbnail' slide_size='full' fx='slide' controls='hide' timeout='4000' speed='1000' ]

    When the page loads with a gallery of say 20 images, every one of those images is the full res file size shrunk down to be displayed at my thumbnail size, resulting in 20 images downloaded at 1.6mb or so. Obviously not the best idea.

    The expected behaviour would be that in the post page displaying the mosaic layout, each image would be thumbnail size and weight, and when clicked to enter the Lightgallery, only then would it pull the full res image.

    I can’t see anywhere in the documentation that there’s a separation between mosiac display image size and (any) lightbox gallery image size. Can I achieve this with Photonic plugin?

    Thanks!
    This seems to be the only issue I have with Photonic but it’s a big one. Everything else seems to be running great!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    The challenge with using a thumbnail size in a mosaic layout is that scaling will really either butcher your image resolution, or reduce the visual impact of a good mosaic. For all other providers (Flickr, SmugMug etc.) there is an option to pick an intermediate “tile” size, however this capability was deliberately not put in for WP galleries due to limitations of predefined sizes and the fact that WP themes let you define their own image sizes.

    If you want to use a non-full size for the tiles, you can, for now, modify a line of code. Go to plugins/photonic/extensions/Photonic_Native_Processor.php, line 124. You will see this:

    $photo_object['tile_image'] = $sources[$id][0];

    Change it to this:

    $photo_object['tile_image'] = $thumbs[$id][0];

    This will pick the thumbnail image instead of the full image.

    I might add a filter or option for this at a later point.

    Plugin Author Sayontan Sinha

    (@sayontan)

    One afterthought, in looking at your site – why not use the images hosted directly on Flickr, instead of downloading them locally? Flickr’s CDN is going to be a lot more robust in serving up images, and you will not really have concerns around the size of images (they will not go through your site as Photonic will pull the photos from Flickr directly).

    If you go to the Flickr gallery that you have linked, you will see that Flickr itself serves up full-size images and it does so pretty fast. In addition, if you were to use Flickr as a direct source, you will be able to make use of the “Tile size” option in the plugin without having to modify any code.

    Thread Starter bkpr

    (@bkpr)

    Hi Sayontan, thanks for your quick reply!

    I considered the Flickr option, but haven’t had much success getting it to work properly (lightbox images were not displaying), but I didn’t put forward much effort to be honest. Ideally I’d prefer to have my data and content in one place but it may not be a deal breaker if I can get it to work directly from Flickr.

    I agree 100% with using a small static size thumbnail for what is an essentially dynamic layout. I edited the Photonic php file as instructed and it worked great, however to your point, the “thumbnail” size is too small/pixelated. Can I edit the code to use the “small” size set in WP Admin, for example:

    $photo_object[’tile_image’] = $small[$id][0]; ?

    Or medium or large for that matter?
    If not I can adjust my thumbnail size to accomodate.

    Thanks again for your quick reply!

    Plugin Author Sayontan Sinha

    (@sayontan)

    If you are interested I can help you with the Flickr setup. The good thing about Flickr and other providers is that they have concepts of albums, collections etc., which WP is very poor with.

    If you are looking to modify the code, you will see this block a few lines above:

    $sources[$id] = wp_get_attachment_image_src($id, $main_size, false);
    $thumbs[$id] = wp_get_attachment_image_src($id, $thumb_size);

    Add a line:
    $tiles[$id] = wp_get_attachment_image_src($id, 'medium');

    Note that medium is a standard size for WP.

    Then, instead of the line in my original post, put in:

    $photo_object['tile_image'] = $tiles[$id][0];

    Thread Starter bkpr

    (@bkpr)

    Hi, thanks again for your help. I’ve changed from WP hosted images to Flickr on that page and I have it all working now I think. Photonic adds a sort of “cover” section photonic-object-header above the masonry output which I’ve hidden with custom CSS:

    div.photonic-object-header.photonic-flickr-set {
        display: none;
    }

    I couldn’t see how to not show this through the plugin itself.

    Plugin Author Sayontan Sinha

    (@sayontan)

    You can turn this off from the plugin using the options under Photonic → Settings → Flickr → Photoset Headers (Standalone Photosets).

    Thread Starter bkpr

    (@bkpr)

    Brilliant, thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Mosaic thumbnails and lightbox images sizes are the same’ is closed to new replies.