mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-15 03:44:05 +00:00
Merge "Revert explict casts and use implict casts as before"
This commit is contained in:
commit
a66de934a7
|
@ -1,3 +1,7 @@
|
|||
<?php
|
||||
|
||||
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
||||
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
||||
|
||||
$cfg['scalar_implicit_cast'] = true;
|
||||
|
||||
return $cfg;
|
||||
|
|
|
@ -212,7 +212,7 @@ class PdfHandler extends ImageHandler {
|
|||
"-quality",
|
||||
$wgPdfHandlerJpegQuality,
|
||||
"-resize",
|
||||
(string)$width,
|
||||
$width,
|
||||
"-",
|
||||
$dstPath
|
||||
);
|
||||
|
@ -329,7 +329,7 @@ class PdfHandler extends ImageHandler {
|
|||
/**
|
||||
* @param File $image
|
||||
* @param string $metadata
|
||||
* @return bool|int
|
||||
* @return bool
|
||||
*/
|
||||
public function isMetadataValid( $image, $metadata ) {
|
||||
if ( !$metadata || $metadata === serialize( [] ) ) {
|
||||
|
|
|
@ -93,9 +93,9 @@ class PdfImage {
|
|||
$size = explode( 'x', $o, 2 );
|
||||
|
||||
if ( $size ) {
|
||||
$width = intval( trim( $size[0] ) ) / 72 * $wgPdfHandlerDpi;
|
||||
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
$height = explode( ' ', trim( $size[1] ), 2 );
|
||||
$height = intval( trim( $height[0] ) ) / 72 * $wgPdfHandlerDpi;
|
||||
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
if ( ( $r / 90 ) & 1 ) {
|
||||
// Swap width and height for landscape pages
|
||||
$t = $width;
|
||||
|
|
Loading…
Reference in a new issue