if ( !$this->normaliseParams( $image, $params ) ) {
return new TransformParameterError( $params );
}
+
# Create a parameter array to pass to the scaler
$scalerParams = array(
# The size to which the image will be resized
}
# Transform functions and binaries need a FS source file
- $scalerParams['srcPath'] = $image->getLocalRefPath();
+ $thumbnailSource = $image->getThumbnailSource( $params );
+
+ $scalerParams['srcPath'] = $thumbnailSource['path'];
+ $scalerParams['srcWidth'] = $thumbnailSource['width'];
+ $scalerParams['srcHeight'] = $thumbnailSource['height'];
+
if ( $scalerParams['srcPath'] === false ) { // Failed to get local copy
wfDebugLog( 'thumbnail',
sprintf( 'Thumbnail failed on %s: could not get local copy of "%s"',
// background colour. After merging we reset the background
// to be white for the default background colour setting
// in the PNG image (which is used in old IE)
- $animation_post = array(
+ $animation_pre = array(
'-background', 'transparent',
'-layers', 'merge',
'-background', 'white',
// bug 66323 - Greyscale images not rendered properly.
// So only take the "red" channel.
$channelOnly = array( '-channel', 'R', '-separate' );
- $animation_post = array_merge( $animation_post, $channelOnly );
+ $animation_pre = array_merge( $animation_pre, $channelOnly );
}
}
}
/**
- * Rerurns whether the file needs to be rendered. Returns true if the
+ * Returns whether the file needs to be rendered. Returns true if the
* file requires rotation and we are able to rotate it.
*
* @param File $file