• I’m running a wordpress (v4.9.6) with woocommerce (v3.4.3) and the BeTheme. We’re using the standard woocommerce API to push our products to the webshop.

    Now all of a sudden when a product is uploaded, there are 19 (!) different thumbnails created. I have no idea from where they get these sizes. I only have the standard ones selected. This is causing a lot of issues on the server side since some shops have over 5000 products.

    This is a screenshot of 1 article with all it’s thumbnails (https://i.stack.imgur.com/nYwrr.jpg)

    Anyone with an idea from were they come and how I could disable this? I already found in the theme functions file there is this:

     if( ! function_exists( 'mfn_add_image_size' ) )
        {
        	function mfn_add_image_size() {
        
        		// Backend --------------------------------------------
        
        			/*
        			 * Featured Image
        			 */
        			set_post_thumbnail_size( 260, 146, false );
        
        			/*
        			 * List Thumbnail for custom post formats
        			 */
        			add_image_size( '50x50', 50, 50, false );
        
        
        		// Builder Items --------------------------------------
        
        			/*
        			 * Clients | do NOT crop logos
        			 */
        			add_image_size( 'clients-slider', 150, 75, false );
        
        			/*
        			 * Slider | Muffin Builder Item
        			 *
        			 * TODO: Verify proportions (? size)
        			 */
        			add_image_size( 'slider-content', 1630, 860, true );
        
        			/*
        			 * Testimonials
        			 *
        			 * TODO: change it to 200x200
        			 */
        			add_image_size( 'testimonials', 	85,   85,   true );
        
        			/*
        			 * Sticky Navigation | Blog, Portfolio & Shop
        			 * Widget: Recent Posts
        			 *
        			 * TODO: connect with testimonials & change it to 200x200
        			 */
        			add_image_size( 'blog-navi', 		80,   80,   true );
        
        
        		// Blog & Portfolio -----------------------------------
        
        			/*
        			 * Portfolio | Style: Masonry flat
        			 *
        			 * TODO: SIZE too big? (use cover/width 100%? ipad?)
        			 */
        			add_image_size( 'portfolio-mf', 	1280, 1000, true );
        			add_image_size( 'portfolio-mf-w',   1280, 500,  true );	/* Wide */
        			add_image_size( 'portfolio-mf-t',   768,  1200, true );	/* Tall	*/
        
        			/*
        			 * Portfolio | Style: List
        			 *
        			 * TODO: Verify proportions (? size)
        			 */
        			add_image_size( 'portfolio-list', 	1920, 750,  true );
        
        
        		// Blog & Portfolio | Dynamic sizes -------------------
        
        			/*
        			 * Blog & Portfolio | List
        			 */
        			$archivesW = mfn_opts_get( 'featured-blog-portfolio-width', 960 );
        			$archivesH = mfn_opts_get( 'featured-blog-portfolio-height', 750 );
        
        			$archivesC = mfn_opts_get( 'featured-blog-portfolio-crop', 'crop' );
        			$archivesC = ( $archivesC == 'resize' ) ? false : true;
        
        			add_image_size( 'blog-portfolio', $archivesW, $archivesH, $archivesC );
        
        			/*
        			 * Blog & Portfolio | Single
        			 */
        			$singleW = mfn_opts_get( 'featured-single-width', 1200 );
        			$singleH = mfn_opts_get( 'featured-single-height', 480 );
        
        			$singleC = mfn_opts_get( 'featured-single-crop', 'crop' );
        			$singleC = ( $singleC == 'resize' ) ? false : true;
        
        			add_image_size( 'blog-single', $singleW, $singleH, $singleC );
        
        	}
        }
        add_action( 'after_setup_theme', 'mfn_add_image_size', 11 );

    But I don’t think this is the issue since a bunch of thumbnail sizes aren’t specified here.

Viewing 5 replies - 1 through 5 (of 5 total)
  • What sorts of “issues” is it actually causing? Having images optimised for all the possible places they could appear will improve performance by only loading images as big as they need to be, and not larger. Some themes also require specific sizes so that the structure of a page isn’t broken by an incorrectly sized image. It’s at the expense of more disk space used, but disk space is pretty affordable these days so is generally worth the trade-off.

    Your theme specifically, based on the code you posted, is adding quite a few (11 at my count). Add the 4 standard WordPress sizes (thumbnail, medium, medium-large and large) as well as WooCommerce’s 3 or 4 and that accounts for pretty much all of them.

    If it really is causing issues then you might want to consider storing the images elsewhere. You can do this with something like Jetpack’s Image CDN, or store them on Amazon S3 with WP Offload S3. If you’re comfortable with something more advanced you could set up your own dynamic image resizing service with Human Made’s Tachyon.

    Thread Starter abotimon

    (@abotimon)

    Hi,
    Thanks for your anwser!

    Well the main issue is the space of the hosting. The sites are webshops, so the focus is on the store. The theme has apparently 19 different thumbnail sizes. Let’s say the shops has 8000 articles with their product image. Those images are never used in a portfolio, slider (or other theme specific things). But none the less the thumbnails for the theme are created. Which means 8000*19, 152.000 images are being created that I will never use…

    I get the use of thumbnails and it’s very necessary. But it baffles me a bit that they are automatically created for everything. Why not only create the necessary thumbnail on the moment it’s being used and store that thumbnail. This way only images used in certain area’s will have thumbnails.

    I fixed it now by commenting out most of the theme specific onces in the theme function file (because they are not being used anyway). But ofcourse this is not a great solution.

    Why not only create the necessary thumbnail on the moment it’s being used and store that thumbnail.

    Because it’s a computationally expensive operation that would then need to occur on page load. Not all hosts would be able to handle that without causing issues for visitors. But what you’re describing is how Tachyon and Jetpack’s Image CDN work. So if that’s what you’re after you can use one of those solutions.

    Thread Starter abotimon

    (@abotimon)

    Because it’s a computationally expensive operation that would then need to occur on page load

    Really? Let’s say you have a folder \images and \images\thumbs.
    Vistor X is the first one to visit my site, he goes to the page with a portfolio or something like that. \image\Picture.jpg is used over there so the site creates a thumbnail and stores it in \image\thumbs\picture_500x500.jpg

    Now vistor Y is coming to my site, he goes to the portfolio page and the page just loads it with the thumb already stored.

    Is this really such a computionally expensive operation like you say? The main issue we have is the harddisk space. Some shops have quota of 1.5GB, which was more then enough before but now not anymore due to soo many pictures.

    Thread Starter abotimon

    (@abotimon)

    Also thanks for your suggestions, I’ll definitely check them out!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Too many thumbnails’ is closed to new replies.