* (bug 21574) Redirects can now have "303 See Other" HTTP status
* EditPage refactored to allow extensions to derive new edit modes much easier.
* (bug 21826) Subsections of Special:Version now also have anchors
+* (bug 19791) Add URL of file source as comment to thumbs (for ImageMagick)
=== Bug fixes in 1.16 ===
* @return MediaTransformOutput
*/
function transform( $params, $flags = 0 ) {
- global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch;
+ global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch, $wgServer;
wfProfileIn( __METHOD__ );
do {
break;
}
+ // Get the descriptionUrl to embed it as comment into the thumbnail. Bug 19791.
+ $descriptionUrl = $this->getDescriptionUrl();
+ if ( $descriptionUrl ) {
+ $params['descriptionUrl'] = $wgServer . $descriptionUrl;
+ }
+
$script = $this->getTransformScript();
if ( $script && !($flags & self::RENDER_NOW) ) {
// Use a script to transform on client request, if possible
$physicalHeight = $params['physicalHeight'];
$clientWidth = $params['width'];
$clientHeight = $params['height'];
+ $descriptionUrl = $params['descriptionUrl'];
$srcWidth = $image->getWidth();
$srcHeight = $image->getHeight();
$mimeType = $image->getMimeType();
// or ImageMagick may decide your ratio is wrong and slice off
// a pixel.
" -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
+ " -set comment " . wfEscapeShellArg( "File source: {$descriptionUrl}" ) .
" -depth 8 $sharpen " .
wfEscapeShellArg($dstPath) . " 2>&1";
wfDebug( __METHOD__.": running ImageMagick: $cmd\n");