Support » Plugin: WordPress Gallery MaxGalleria » Control over gallery image sizes

  • kidznc

    (@wsp-kk)


    I’m not sure whether this is a complaint or a feature request, but here goes:

    I manage a site that currently has over 10k photos in its directories – far too many of them generated by plugins, MaxGalleria’s six non-optional sizes notwithstanding:

    		add_image_size(MAXGALLERIA_META_IMAGE_THUMB_SMALL, 100, 100, true);
    		add_image_size(MAXGALLERIA_META_IMAGE_THUMB_MEDIUM, 150, 150, true);
    		add_image_size(MAXGALLERIA_META_IMAGE_THUMB_LARGE, 200, 200, true);
    		add_image_size(MAXGALLERIA_META_VIDEO_THUMB_SMALL, 150, 100, true);
    		add_image_size(MAXGALLERIA_META_VIDEO_THUMB_MEDIUM, 200, 133, true);
    		add_image_size(MAXGALLERIA_META_VIDEO_THUMB_LARGE, 250, 166, true);
    

    This tends to create a problem, as I’m trying to keep the number of thumbnail sizes down. If it were not for the limitations I set in functions.php, each image is generated in 17 different sizes, and that’s after throwing out the plugins that shouldn’t be there.

    Put simply, I see no reason why I should wind up with 1000+ images after uploading 100), and I’m not keen on being locked into the six that MaxGalleria tries to obligate me to – especially since I only use the four column template, which apparently uses MAXGALLERIA_META_VIDEO_THUMB_LARGE, 250, 166, to generate its images.

    However, if I do filter out the sizes I don’t want, MaxGalleria won’t show anything – it insists on using its “…250×166.jpg” images.

    Far as I can see, this isn’t changeable yet, which is hugely frustrating given that we now have WordPress SRCSET sizes. I don’t mind if the source images are a bit bigger than the actual ones on screen; the page speed that I’ll gain out of it isn’t worth the mess of images or the management of them all.

    Curious to hear if you have any suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AlanP57

    (@alanp57)

    We are considering writing something that would help cut down on the number of thumbnails generated, but that is months away from being developed.

    For now you can try using the remove_image_size function in your theme’s function.php to see if you can remove an existing thumbnail size. If it works, you can add this function for each size thumbnail want to stop being generated.

    Learn more about the function here, https://developer.wordpress.org/reference/functions/remove_image_size/

    kidznc

    (@wsp-kk)

    I’m presently using that code to unset the sizes generated by other plugins (and the theme), but I’m also locking down the image sizes with the intermediate_image_sizes hook:

    
    //ONLY ALLOW THE FOLLOWING MEDIA SIZES
    add_filter( 'intermediate_image_sizes', 'image_restrict' );
    function image_restrict( $sizes ) {
    return array( 'folio', 'gallery', 'downloads', 'medium_large', 'blog400' );
    }
    

    This is more or less what you’ve recommended, but it still means I have to OK one more image size. MaxGalleria’s default Image Tiles gallery really should have a simple conditional fallback that allows it to use the next available image size if the ideal one isn’t available. It’s quite annoying to have to OK yet one more image size, or to find that somewhere in your 100+ galleries, there is one photo or gallery that slipped through without getting generated into the right size for whatever reason.

    Another thing I’ve noticed is that WordPress sometimes makes a mistake generating the images that are resized by multiples of 33.3% or 66.6%. I’ve found images resized to ...-250x167.jpg when Max is calling for ...-250x166.jpg

    It’s just extremely annoying, and enough that I’m willing to spend a few days with the interconnect/it serialized search and replace tool and transfer all the galleries over to Modula, which can display any combination of columns without ever requiring a custom image size.

    • This reply was modified 6 months ago by  kidznc.
    • This reply was modified 6 months ago by  kidznc.
    • This reply was modified 6 months ago by  kidznc.
    • This reply was modified 6 months ago by  kidznc.

    Hi Alan

    I also realized that thumbnails are generated when showing the gallery, e.g. 180×180 when having a squared 6 column image tiles. I currently disable this by e.g. using the maxgalleria_thumb_size_square_six_column filter but don’t feel very comfortable with it because I fear some performance issues when applying all those filters.

    Can you please also consider this issue when developing your new approach? IMO, it would be totally okay to use the default WP thumbnail by default and may introduce 1 optional MaxGalleria specific thumbnail.

    Best regards
    Christian

    Plugin Author AlanP57

    (@alanp57)

    Thank you Christian. If we decide to improve the performance of the plugin, we will consider this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.