Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -529,7 +529,7 @@ |
530 | 530 | * @return MediaTransformOutput |
531 | 531 | */ |
532 | 532 | function transform( $params, $flags = 0 ) { |
533 | | - global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch; |
| 533 | + global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch, $wgServer; |
534 | 534 | |
535 | 535 | wfProfileIn( __METHOD__ ); |
536 | 536 | do { |
— | — | @@ -539,6 +539,12 @@ |
540 | 540 | break; |
541 | 541 | } |
542 | 542 | |
| 543 | + // Get the descriptionUrl to embed it as comment into the thumbnail. Bug 19791. |
| 544 | + $descriptionUrl = $this->getDescriptionUrl(); |
| 545 | + if ( $descriptionUrl ) { |
| 546 | + $params['descriptionUrl'] = $wgServer . $descriptionUrl; |
| 547 | + } |
| 548 | + |
543 | 549 | $script = $this->getTransformScript(); |
544 | 550 | if ( $script && !($flags & self::RENDER_NOW) ) { |
545 | 551 | // Use a script to transform on client request, if possible |
Index: trunk/phase3/includes/media/Bitmap.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | $physicalHeight = $params['physicalHeight']; |
62 | 62 | $clientWidth = $params['width']; |
63 | 63 | $clientHeight = $params['height']; |
| 64 | + $descriptionUrl = $params['descriptionUrl']; |
64 | 65 | $srcWidth = $image->getWidth(); |
65 | 66 | $srcHeight = $image->getHeight(); |
66 | 67 | $mimeType = $image->getMimeType(); |
— | — | @@ -154,6 +155,7 @@ |
155 | 156 | // or ImageMagick may decide your ratio is wrong and slice off |
156 | 157 | // a pixel. |
157 | 158 | " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) . |
| 159 | + " -set comment " . wfEscapeShellArg( "File source: {$descriptionUrl}" ) . |
158 | 160 | " -depth 8 $sharpen " . |
159 | 161 | wfEscapeShellArg($dstPath) . " 2>&1"; |
160 | 162 | wfDebug( __METHOD__.": running ImageMagick: $cmd\n"); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -298,6 +298,7 @@ |
299 | 299 | * (bug 21574) Redirects can now have "303 See Other" HTTP status |
300 | 300 | * EditPage refactored to allow extensions to derive new edit modes much easier. |
301 | 301 | * (bug 21826) Subsections of Special:Version now also have anchors |
| 302 | +* (bug 19791) Add URL of file source as comment to thumbs (for ImageMagick) |
302 | 303 | |
303 | 304 | === Bug fixes in 1.16 === |
304 | 305 | |