* (bug 12695) Suppress dvips verbiage from web server error log
* (bug 12716) Unprotecting a non-protected page leaves a log entry
* Log username blocks with canonical form of name instead of input form
+* (bug 11593, 12719) Fixes for overzealous invocation of thumb.php.
+ Non-image handlers and full-size images may now decline it, fixing
+ mystery failures when using $wgThumbnailScriptPath.
== Parser changes in 1.12 ==
$script = $this->getTransformScript();
if ( $script && !($flags & self::RENDER_NOW) ) {
- // Use a script to transform on client request
+ // Use a script to transform on client request, if possible
$thumb = $this->handler->getScriptedTransform( $this, $script, $params );
- break;
+ if( $thumb ) {
+ break;
+ }
}
$normalisedParams = $params;
$thumbName = $this->thumbName( $normalisedParams );
$thumbPath = $this->getThumbPath( $thumbName );
$thumbUrl = $this->getThumbUrl( $thumbName );
-
+
if ( $this->repo->canTransformVia404() && !($flags & self::RENDER_NOW ) ) {
$thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
break;
*/
function isMetadataValid( $image, $metadata ) { return true; }
+
+ /**
+ * Get a MediaTransformOutput object representing an alternate of the transformed
+ * output which will call an intermediary thumbnail assist script.
+ *
+ * Used when the repository has a thumbnailScriptUrl option configured.
+ *
+ * Return false to fall back to the regular getTransform().
+ */
+ function getScriptedTransform( $image, $script, $params ) {
+ return false;
+ }
+
/**
* Get a MediaTransformOutput object representing the transformed output. Does not
* actually do the transform.
}
$url = $script . '&' . wfArrayToCGI( $this->getScriptParams( $params ) );
$page = isset( $params['page'] ) ? $params['page'] : false;
- return new ThumbnailImage( $image, $url, $params['width'], $params['height'], $page );
+
+ if( $image->mustRender() || $params['width'] < $image->getWidth() ) {
+ return new ThumbnailImage( $image, $url, $params['width'], $params['height'], $page );
+ }
}
function getImageSize( $image, $path ) {