r75748 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75747‎ | r75748 | r75749 >
Date:21:49, 31 October 2010
Author:hartman
Status:ok
Tags:
Comment:
Add a new isVectorized() to files and media handlers. Only SVG returns true.

Related to Bug 19633.
Modified paths:
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/media/Generic.php (modified) (history)
  • /trunk/phase3/includes/media/SVG.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/File.php
@@ -267,6 +267,19 @@
268268 }
269269
270270 /**
 271+ * Get the duration of a media file in seconds
 272+ */
 273+ public function isVectorized() {
 274+ $handler = $this->getHandler();
 275+ if ( $handler ) {
 276+ return $handler->isVectorized( $this );
 277+ } else {
 278+ return false;
 279+ }
 280+ }
 281+
 282+
 283+ /**
271284 * Get handler-specific metadata
272285 * Overridden by LocalFile, UnregisteredLocalFile
273286 * STUB
Index: trunk/phase3/includes/media/Generic.php
@@ -162,6 +162,10 @@
163163 */
164164 function pageCount( $file ) { return false; }
165165 /**
 166+ * The material is vectorized and thus scaling is lossless
 167+ */
 168+ function isVectorized( $file ) { return false; }
 169+ /**
166170 * False if the handler is disabled for all files
167171 */
168172 function isEnabled() { return true; }
Index: trunk/phase3/includes/media/SVG.php
@@ -26,6 +26,10 @@
2727 return true;
2828 }
2929
 30+ function isVectorized( $file ) {
 31+ return true;
 32+ }
 33+
3034 function normaliseParams( $image, &$params ) {
3135 global $wgSVGMaxSize;
3236 if ( !parent::normaliseParams( $image, $params ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r75749Upscale thumbnails of SVGs if the nominal size of the SVG is smaller than the...hartman21:53, 31 October 2010
r75816Follow-up r75748: Fix commentraymond19:00, 1 November 2010

Status & tagging log