Use the attachment metadata to get the size infomation rather than making an HTTP request for the image in the attachment template.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-05-16 21:02:34 +00:00
parent 01389755c7
commit 32b4cbe0da

View File

@ -42,13 +42,13 @@
);
if ( wp_attachment_is_image() ) {
echo ' <span class="meta-sep">|</span> ';
$size = getimagesize( wp_get_attachment_url() );
$metadata = wp_get_attachment_metadata();
printf( __( 'Full size is %s pixels', 'twentyten'),
sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
wp_get_attachment_url(),
esc_attr( __('Link to full-size image', 'twentyten') ),
$size[0],
$size[1]
$metadata['width'],
$metadata['height']
)
);
}