[wp-testers] Problem with wp_get_attachment_image() in WP 3 beta

Tom Lany mail at tomlany.net
Wed May 26 05:27:01 UTC 2010


WordPress appears to not be giving me the most optimized image when I 
use an array with the wp_get_attachment_image() function on the latest 
WordPress nighly build.

I wrote a plugin 
(http://wordpress.org/extend/plugins/use-the-attachment-image/) that 
uses this function to pull the first attachment image associated with a 
post onto a page.  When I use an array to size the image to 200x200 with 
WordPress 2.9.2, the medium size image is used to render the 200x200 
image, saving bandwith.  With the latest beta, the largest possible 
image is used to render a 200x200 image.

See these examples:

WordPress 2.9.2: http://jingletom.com/beta/image-test/
WordPress 3.0 latest nightly build: 

Scroll down to the bottom of the pages to see the 200x200 example, 
right-click on the image, and you will see the different size images 
that are being served in the different respective versions of WordPress.

I am using the same code to call the function, the same plugin code, and 
am not receiving any errors with WP_DEBUG turned on.

It is possible that this has to do with my plugin, but it seemed more 
like this is an issue with the image WordPress is feeding me.  Let me 
know if you have ideas about this or if my plugin that is causing issues.

Let me know if anyone has any questions, and thanks in advance for your 

Tom Lany

More information about the wp-testers mailing list