Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • I think I have narrowed it down to my MAMP development environment. Upgrading a 2.3.1 site to 2.3.2 on Dreamhost (LAMP) does not introduce this problem.

    I tried exporting the same image at a few different dimensions, and the 800 height version always fails and the 600 height version always works. So I thought it must have something to do with image size, but a certain 84k 800×437 image always fails and a 116k 363×800 image always works.

    On testing, the plugin version works for me, but the functions.php version doesn’t seem to…

    Any word on this? It seems to work on occasion, but I can’t reproduce when it does and when it doesn’t.

    When it doesn’t work the upload area goes blank on upload, and refreshing the page shows the full image with no thumbnail in browse all.

    Photos that are twice as tall as they are wide seem to always work, while some others never work, and some sometimes work.

    (?)

    alternately, just add this to functions.php for your theme:

    // 	change thumbnail to consistent width
    function custom_thumbsize( $size, $attachment_id, $file )
    {
    	$th_width = 550;
    
    	$image_attr = getimagesize( $file );
    
    	if ( $image_attr[0] < $image_attr[1] )
    	{
    		// 	image is portrait, make it fit in the width
    		return round( $image_attr[1] / $image_attr[0] * $th_width );
    	}
    	else
    	{
    		// 	image square or landscape, make it fit the width
    		return $th_width;
    	}
    }
    
    add_filter( 'wp_thumbnail_max_side_length', 'custom_thumbsize', 10, 3 );

    Make thumbsize.php in your plugins directory and enable this plugin:

    <?php
    
    /*
    Plugin Name: Thumbnail Sizes
    Plugin URI: http://wordpress.org/support/topic/147572
    Description: Fixed thumbnail width.
    Version: 1.0
    Author: Forrest O.
    Author URI: http://sembiki.com/
    */
    
    // 	change thumbnail to consistent width
    function custom_thumbsize( $size, $attachment_id, $file )
    {
    	$th_width = 550;
    
    	$image_attr = getimagesize( $file );
    
    	if ( $image_attr[0] < $image_attr[1] )
    	{
    		// 	image is portrait, make it fit in the width
    		return round( $image_attr[1] / $image_attr[0] * $th_width );
    	}
    	else
    	{
    		// 	image square or landscape, make it fit the width
    		return $th_width;
    	}
    }
    
    add_filter( 'wp_thumbnail_max_side_length', 'custom_thumbsize', 10, 3 );
    
    ?>

    Does this work for you? Doing it as a plugin gives you the advantage of not overwriting changes on an upgrade.

    Thumbnails stopped working on upgrade to 2.3.2 from 2.3.1 for me as well.

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