r101814 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101813‎ | r101814 | r101815 >
Date:14:32, 3 November 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
output rendered thumbnail once form is submitted

We probably want to force thumbnail rendering unconditionally. For some
reason the File::RENDER_NOW does not force a rendering with vips. At
least there is nothing showing up in the debug log when the thumbnail
had already been generated.
Modified paths:
  • /trunk/extensions/VipsScaler/SpecialVipsTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VipsScaler/SpecialVipsTest.php
@@ -75,12 +75,19 @@
7676 }
7777
7878 $params = array( 'width' => $width );
79 - $thumb = $file->transform( $params );
 79+ # FIXME: somehow RENDER_NOW does not seem to force rendering :(
 80+ $thumb = $file->transform( $params, File::RENDER_NOW );
8081 if ( !$thumb || $thumb->isError() ) {
8182 $this->getOutput()->addWikiMsg( 'vipsscaler-thumb-error' );
 83+ return;
8284 }
8385
84 - $this->makeUrl( $file, $width );
 86+ $this->getOutput()->addHTML(
 87+ $thumb->toHtml( array(
 88+ # Options for the thumbnail. See ThumbnailImage::toHtml()
 89+ 'desc-link' => true,
 90+ ) )
 91+ );
8592 }
8693
8794 /**
@@ -253,13 +260,6 @@
254261 }
255262 }
256263
257 - /**
258 - *
259 - */
260 - protected function makeUrl( $file, $width ) {
261 -
262 - }
263 -
264264 protected function streamError( $code ) {
265265
266266 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r101835Force thumb rendering!...hashar17:08, 3 November 2011

Comments

#Comment by Hashar (talk | contribs)   17:36, 3 November 2011

force rendering added with r101835

Status & tagging log