r101835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101834‎ | r101835 | r101836 >
Date:17:08, 3 November 2011
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
Force thumb rendering!

Since the [[Special:VipsTest]] is used to test the vips scaler, we want
to make sure the thumb is actually rendered and not showing an old
rendering.

Requires MediaWiki Core r101833
Modified paths:
  • /trunk/extensions/VipsScaler/SpecialVipsTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VipsScaler/SpecialVipsTest.php
@@ -75,8 +75,8 @@
7676 }
7777
7878 $params = array( 'width' => $width );
79 - # FIXME: somehow RENDER_NOW does not seem to force rendering :(
80 - $thumb = $file->transform( $params, File::RENDER_NOW );
 79+ // RENDER_FORCE requires MediaWiki core r101833
 80+ $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE );
8181 if ( !$thumb || $thumb->isError() ) {
8282 $this->getOutput()->addWikiMsg( 'vipsscaler-thumb-error' );
8383 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r102029Follow-up r101835, basic functionality in SpecialVipsTest. Needs some polishingbtongminh18:55, 4 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101814output rendered thumbnail once form is submitted...hashar14:32, 3 November 2011
r101833let us force thumb rendering even if previous file exist...hashar17:06, 3 November 2011

Comments

#Comment by Bryan (talk | contribs)   22:09, 3 November 2011

I think you are making wrong assumptions here.

We will run SpecialVipsTest while Imagemagick is still the default rendered. So, File::transform will return an Imagemagick thumbnail. This thumbnail does not need to be regenerated, so RENDER_FORCE should not be necessary.

Currently you only show the Imagemagick thumbnail. SpecialVipsTest should output both the Imagemagick thumbnail, and the vips thumbnail. The vips thumbnail should be a thumbnail refering to the the stream function of the special page.

#Comment by Hashar (talk | contribs)   18:11, 4 November 2011

I have to look at that streamFunction. Right now, on my installation, imagemagick seems to get skipped and only vips is used. I will have to add some watermark to the thumbnails to differentiate between IM and vips :D

#Comment by Bryan (talk | contribs)   18:24, 4 November 2011

Indeed, by default everything is scaled by vips. To disable scaling, set $wgVipsOptions = array();

Status & tagging log