Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki-CVS

SVN: [40095] trunk/phase3

 

 

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded


hashar at svn

Aug 27, 2008, 11:25 AM

Post #1 of 1 (22 views)
Permalink
SVN: [40095] trunk/phase3

Revision: 40095
Author: hashar
Date: 2008-08-27 18:25:24 +0000 (Wed, 27 Aug 2008)

Log Message:
-----------
Lets render BMP pictures to PNG.

Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES
trunk/phase3/includes/media/BMP.php
trunk/phase3/includes/media/Bitmap.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES 2008-08-27 18:23:03 UTC (rev 40094)
+++ trunk/phase3/RELEASE-NOTES 2008-08-27 18:25:24 UTC (rev 40095)
@@ -98,8 +98,8 @@
* Add tooltips to rollback and undo links
* Backend upload code has been removed from SpecialUpload.php. This may cause
backwards incompatibility with upload extensions.
+* BMP images are now displayed as PNG

-
=== Bug fixes in 1.14 ===

* (bug 14907) DatabasePostgres::fieldType now defined.

Modified: trunk/phase3/includes/media/BMP.php
===================================================================
--- trunk/phase3/includes/media/BMP.php 2008-08-27 18:23:03 UTC (rev 40094)
+++ trunk/phase3/includes/media/BMP.php 2008-08-27 18:25:24 UTC (rev 40095)
@@ -11,7 +11,16 @@
* @ingroup Media
*/
class BmpHandler extends BitmapHandler {
+ // We never want to use .bmp in an <img/> tag
+ function mustRender( $file ) {
+ return true;
+ }

+ // Render files as PNG
+ function getThumbType( $text, $mime ) {
+ return array( 'png', 'image/png' );
+ }
+
/*
* Get width and height from the bmp header.
*/

Modified: trunk/phase3/includes/media/Bitmap.php
===================================================================
--- trunk/phase3/includes/media/Bitmap.php 2008-08-27 18:23:03 UTC (rev 40094)
+++ trunk/phase3/includes/media/Bitmap.php 2008-08-27 18:25:24 UTC (rev 40095)
@@ -59,7 +59,7 @@
$retval = 0;
wfDebug( __METHOD__.": creating {$physicalWidth}x{$physicalHeight} thumbnail at $dstPath\n" );

- if ( $physicalWidth == $srcWidth && $physicalHeight == $srcHeight ) {
+ if ( !$image->mustRender() && $physicalWidth == $srcWidth && $physicalHeight == $srcHeight ) {
# normaliseParams (or the user) wants us to return the unscaled image
wfDebug( __METHOD__.": returning unscaled image\n" );
return new ThumbnailImage( $image, $image->getURL(), $clientWidth, $clientHeight, $srcPath );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Wikipedia mediawiki-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.