[wp-trac] [WordPress Trac] #13556: wp_get_attachment_image() displays larger images than necessary with an array

WordPress Trac wp-trac at lists.automattic.com
Wed May 26 16:41:28 UTC 2010


#13556: wp_get_attachment_image() displays larger images than necessary with an
array
-----------------------------+----------------------------------------------
 Reporter:  tomthewebmaster  |       Owner:     
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  3.0
Component:  Media            |     Version:  3.0
 Severity:  normal           |    Keywords:     
-----------------------------+----------------------------------------------
 WordPress is not giving me the most optimized image when I use an array
 with the wp_get_attachment_image() function in the WordPress 3.0 builds.

 I used the following code on a page: <?php echo
 wp_get_attachment_image(60, array(200,200), false); ?>.  While the correct
 sized image is displayed on the page, WordPress is using the full size
 image to scale from, instead of scaling from the medium size image.  I am
 given the most optimized image (medium) as expected in WordPress 2.9.2.

 See these examples:

 WordPress 3.0 nightly build, where the full size image is used:
 http://jingletom.com/beta/image-test-2/
 WordPress 2.9.2, where the medium image is used: http://tomlany.net/use-
 the-attachment-image/image-test/

 In both cases, you want to look at the top image on the page. Right click
 on the images to see the different sized images that are being used.  In
 both cases, the medium image is set to be the default 300x300 in the
 administration panel.

 Let me know if anyone has any questions.  Thanks!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13556>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list