mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 11:59:56 +00:00
unify the file creation method
This commit is contained in:
parent
ff623260e7
commit
8e1834c810
|
@ -41,8 +41,8 @@ class NodeImage extends Node {
|
|||
*/
|
||||
public function resolveImageUrl( $title ) {
|
||||
if ( $title ) {
|
||||
$file = \WikiaFileHelper::getFileFromTitle($title);
|
||||
if ($file) {
|
||||
$file = \WikiaFileHelper::getFileFromTitle( $title );
|
||||
if ( $file ) {
|
||||
return $file->getUrl();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ class PortableInfoboxRenderService extends WikiaService {
|
|||
private function createVignetteThumbnail( $url ) {
|
||||
return VignetteRequest::fromUrl( $url )
|
||||
->thumbnailDown()
|
||||
->width(F::app()->checkSkin( 'wikiamobile' ) ?
|
||||
->width( F::app()->checkSkin( 'wikiamobile' ) ?
|
||||
self::MOBILE_THUMBNAIL_WIDTH :
|
||||
self::DESKTOP_THUMBNAIL_WIDTH
|
||||
)
|
||||
|
@ -197,15 +197,15 @@ class PortableInfoboxRenderService extends WikiaService {
|
|||
* @desc If the image is served from an old
|
||||
* service we have to again obtain file to
|
||||
* call the createThumb function
|
||||
* @param $name
|
||||
* @param $title
|
||||
* @return mixed
|
||||
*/
|
||||
private function createOldThumbnail( $name )
|
||||
private function createOldThumbnail( $title )
|
||||
{
|
||||
$file = wfFindFile( $name );
|
||||
$file = \WikiaFileHelper::getFileFromTitle( $title );
|
||||
if ( $file ) {
|
||||
return $file->createThumb(
|
||||
F::app()->checkSkin('wikiamobile') ?
|
||||
F::app()->checkSkin( 'wikiamobile' ) ?
|
||||
self::MOBILE_THUMBNAIL_WIDTH :
|
||||
self::DESKTOP_THUMBNAIL_WIDTH
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue