Skip to content
This repository has been archived by the owner on Jan 27, 2018. It is now read-only.

Commit

Permalink
Sizing fix from kitchin
Browse files Browse the repository at this point in the history
  • Loading branch information
dlanger committed Jan 24, 2012
1 parent 58b0e76 commit 1e839d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions simpleslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ function sss_handle_shortcode( $attrs ) {
$thumb_w = $thumb_h = 0;
$captions = array();
foreach ( $images as $image_id => $image_data ) {
$info = wp_get_attachment_metadata( $image_id );
$thumb_w = max ( $thumb_w, $info[ 'sizes' ][ $size ][ 'width' ] );
$thumb_h = max ( $thumb_h, $info[ 'sizes' ][ $size ][ 'height' ] );
$image_props[ $image_id ] = wp_get_image_src( $image_id, $size );
$thumb_w = max ( $thumb_w, $image_props[ $image_id ][ 1 ] );
$thumb_h = max ( $thumb_h, $image_props[ $image_id ][ 2 ] );
$captions[ $image_id ] = $image_data->post_excerpt;
}

Expand All @@ -129,7 +129,7 @@ function sss_handle_shortcode( $attrs ) {
foreach ( $images as $image_id => $image_data ) {
$opacity = $first ? '1' : '0';
$first = false;
$image_prop = wp_get_attachment_image_src( $image_id, $size );
$image_prop = $image_props[ $image_id ];
$image_tag = "<img src=\"${image_prop[ 0 ]}\" " .
"width=\"${image_prop[ 1 ]}\" " .
"height=\"${image_prop[ 2 ]}\" " .
Expand Down

0 comments on commit 1e839d9

Please sign in to comment.