X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=3b7ff43612bee0a80ca5c1055c242b38f9c795a0;hb=5c50bb4caf947fd5aa934c1b83816bc460bd7cc5;hp=b530bb586e1bdb09691b01a60fd9689a49c9995c;hpb=a1b2e33653019c272c68602992df6e1cc0e4f804;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index b530bb586e..3b7ff43612 100644 --- a/thumb.php +++ b/thumb.php @@ -301,9 +301,15 @@ function wfStreamThumb( array $params ) { // Stream the file if it exists already... $thumbPath = $img->getThumbPath( $thumbName ); if ( $img->getRepo()->fileExists( $thumbPath ) ) { + $starttime = microtime( true ); $success = $img->getRepo()->streamFile( $thumbPath, $headers ); + $streamtime = microtime( true ) - $starttime; + if ( !$success ) { wfThumbError( 500, 'Could not stream the file' ); + } else { + RequestContext::getMain()->getStats()->timing( 'media.thumbnail.stream', $streamtime ); + wfDebugLog( 'thumbnailaccess', time() . ' ' . $thumbPath . ' ' . ob_get_length() . ' Streamed ' ); } return; } @@ -317,8 +323,8 @@ function wfStreamThumb( array $params ) { return; } - // Actually generate a new thumbnail list( $thumb, $errorMsg ) = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath ); + /** @var MediaTransformOutput|bool $thumb */ // Check for thumbnail generation errors...