X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=blobdiff_plain;f=thumb.php;h=d7bf45338241431d3324fcb90102453dd8db240d;hb=b2cfe401382b53e6d862fecd1ba200e1842d5cfa;hp=3d49a4353bf9c8b9b33a279c8000744a04674181;hpb=a530be17cfef51d4e9005082fab29b25616af223;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 3d49a4353b..d7bf453382 100644 --- a/thumb.php +++ b/thumb.php @@ -116,6 +116,10 @@ function wfStreamThumb( array $params ) { $params['width'] = $params['w']; unset( $params['w'] ); } + if ( isset( $params['width'] ) && substr( $params['width'], -2 ) == 'px' ) { + // strip the px (pixel) suffix, if found + $params['width'] = substr( $width, 0, strlen( $width ) - 2 ); + } if ( isset( $params['p'] ) ) { $params['page'] = $params['p']; } @@ -394,7 +398,7 @@ function wfGenerateThumbnail( File $file, array $params, $thumbName, $thumbPath // If the worker that finished made this thumbnail then use it. // Otherwise, it probably made a different thumbnail for this file. return $file->getRepo()->fileExists( $thumbPath ) - ? $file->transform( $params ) + ? $file->transform( $params, File::RENDER_NOW ) : false; // retry once more in exclusive mode }, 'fallback' => function() {