• Resolved adejones

    (@adejones)


    I have been asked to look in to an issue for someone who is using a theme with eshop plugin.
    The thumbnails of the product images on the home page are squashed and out of proportion.
    The code for the thumbnails is as follows:

    <?php
    	add_theme_support( 'post-thumbnails' );
    
    	global $et_theme_image_sizes;
    
    	$et_theme_image_sizes = array(
    		'113x96' 	=> 'et-functions-thumb',
    		'249x244' 	=> 'et-functions-blog-thumb',
    		'137x121' 	=> 'et-home-thumb',
    		'200x200' 	=> 'et-loop-page-thumb',
    		'380x230' 	=> 'et-featured-thumb',
    	);
    
    	$et_page_templates_image_sizes = array(
    		'184x184' 	=> 'et-blog-page-thumb',
    		'207x136' 	=> 'et-gallery-page-thumb',
    		'260x170' 	=> 'et-portfolio-medium-page-thumb',
    		'260x315' 	=> 'et-portfolio-medium-portrait-page-thumb',
    		'140x94' 	=> 'et-portfolio-small-page-thumb',
    		'140x170' 	=> 'et-portfolio-small-portrait-page-thumb',
    		'430x283' 	=> 'et-portfolio-large-page-thumb',
    		'430x860' 	=> 'et-portfolio-large-portrait-page-thumb',
    	);
    
    	$et_theme_image_sizes = array_merge( $et_theme_image_sizes, $et_page_templates_image_sizes );
    
    	$et_theme_image_sizes = apply_filters( 'et_theme_image_sizes', $et_theme_image_sizes );
    	$crop = apply_filters( 'et_post_thumbnails_crop', true );
    
    	if ( is_array( $et_theme_image_sizes ) ){
    		foreach ( $et_theme_image_sizes as $image_size_dimensions => $image_size_name ){
    			$dimensions = explode( 'x', $image_size_dimensions );
    			add_image_size( $image_size_name, $dimensions[0], $dimensions[1], $crop );
    		}
    	}
    ?>

    Is there anything I can modify that would stop the product images becoming out of proportion?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Can you post a URL to a page showing a squashed image?

    Thread Starter adejones

    (@adejones)

    Here we go

    The “Recommended Products” are set to 137×121 and the ones below, the “Recent Products” which is slightly more noticeable are set to 113×96

    Were these images present before the current theme was activated? If so it may be appropriate to regenerate the thumbnails. The squished ones are simply large images being soft cropped to display at the defined image sizes and the aspect ratio doesn’t match.

    Thread Starter adejones

    (@adejones)

    As far as I am aware, the current theme is the only one that has even been used on this site so the thumbnails were inserted after it was initially activated.

    I will try that plugin on the site I sent you a link to, that is a test version of the site, not the actual live site.

    Thread Starter adejones

    (@adejones)

    Take another look, they have definitely changed and look better to me.

    Definitely. A hard crop has been applied now. Some of the images have been cropped top/bottom but like you say, it looks better now.

    Thread Starter adejones

    (@adejones)

    Thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Thumbnails becoming squashed images’ is closed to new replies.