Index: trunk/phase3/includes/media/Generic.php |
— | — | @@ -357,9 +357,19 @@ |
358 | 358 | if ( !isset( $params['width'] ) ) { |
359 | 359 | return false; |
360 | 360 | } |
| 361 | + |
361 | 362 | if ( !isset( $params['page'] ) ) { |
362 | 363 | $params['page'] = 1; |
| 364 | + } else { |
| 365 | + if ( $params['page'] > $image->pageCount() ) { |
| 366 | + $params['page'] = $image->pageCount(); |
| 367 | + } |
| 368 | + |
| 369 | + if ( $params['page'] < 1 ) { |
| 370 | + $params['page'] = 1; |
| 371 | + } |
363 | 372 | } |
| 373 | + |
364 | 374 | $srcWidth = $image->getWidth( $params['page'] ); |
365 | 375 | $srcHeight = $image->getHeight( $params['page'] ); |
366 | 376 | if ( isset( $params['height'] ) && $params['height'] != -1 ) { |