r98812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98811‎ | r98812 | r98813 >
Date:22:04, 3 October 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 31282) Fix use of ForeignAPIRepo/InstantCommons TIFF images when $wgTiffThumbnailType is left unset.

When pulling files over ForeignAPIRepo, the source site is what creates the thumbnails; we don't care whether we can locally produce thumbs of TIFFs.
This feels a bit hacky, and may indicate we need to better refactor media handlers & file repositories. As long as the source site can produce a thumbnail image URL or a chunk of HTML to export, the local site shouldn't have to touch any of that stuff and should just be passing data through.
Modified paths:
  • /trunk/phase3/includes/media/Tiff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Tiff.php
@@ -17,13 +17,18 @@
1818 * Conversion to PNG for inline display can be disabled here...
1919 * Note scaling should work with ImageMagick, but may not with GD scaling.
2020 *
 21+ * Files pulled from an another MediaWiki instance via ForeignAPIRepo /
 22+ * InstantCommons will have thumbnails managed from the remote instance,
 23+ * so we can skip this check.
 24+ *
2125 * @param $file
2226 *
2327 * @return bool
2428 */
2529 function canRender( $file ) {
2630 global $wgTiffThumbnailType;
27 - return (bool)$wgTiffThumbnailType;
 31+ return (bool)$wgTiffThumbnailType
 32+ || ($file->getRepo() instanceof ForeignAPIRepo);
2833 }
2934
3035 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r990941.18wmf1: MFT r98235, r98411, r98665, r98676, r98678, r98773, r98812, r99082,...catrope13:01, 6 October 2011
r99989REL1_18:...reedy22:24, 16 October 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   22:07, 3 October 2011

May not be strictly needed on WMF production (PagedTiffHandler probably takes over from it already) but def. want in 1.18 for InstantCommons users.

Status & tagging log