diff options
-rw-r--r-- | phpBB/config/default/container/services.yml | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 4 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/driver.php | 6 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/gravatar.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/local.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/remote.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 4 | ||||
-rw-r--r-- | tests/avatar/manager_test.php | 2 | ||||
-rw-r--r-- | tests/upload/imagesize_test.php | 8 |
10 files changed, 18 insertions, 18 deletions
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml index 11bc6728a6..682eaeb200 100644 --- a/phpBB/config/default/container/services.yml +++ b/phpBB/config/default/container/services.yml @@ -203,7 +203,7 @@ services: class: phpbb\template\context upload_imagesize: - class: phpbb\upload\imagesize + class: fastImageSize\fastImageSize version_helper: class: phpbb\version_helper diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index f605f89d4d..ea82a23082 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -401,9 +401,9 @@ class filespec $this->width = $this->height = 0; // Get imagesize class - $imagesize = new \phpbb\upload\imagesize(); + $imagesize = new \fastImageSize\fastImageSize(); - $this->image_info = $imagesize->get_imagesize($this->destination_file, $this->mimetype); + $this->image_info = $imagesize->getImageSize($this->destination_file, $this->mimetype); if ($this->image_info !== false) { diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 3d263748cb..bc53336a3f 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -339,8 +339,8 @@ class bbcode_firstpass extends bbcode if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) { - $imagesize = new \phpbb\upload\imagesize(); - $size_info = $imagesize->get_imagesize(htmlspecialchars_decode($in)); + $imagesize = new \fastImageSize\fastImageSize(); + $size_info = $imagesize->getImageSize(htmlspecialchars_decode($in)); if ($size_info === false) { diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index aa92ba2012..b6fd380bda 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -30,7 +30,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface */ protected $config; - /** @var \phpbb\upload\imagesize */ + /** @var \fastImageSize\fastImageSize */ protected $imagesize; /** @@ -76,13 +76,13 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface * Construct a driver object * * @param \phpbb\config\config $config phpBB configuration - * @param \phpbb\upload\imagesize $imagesize phpBB imagesize class + * @param \fastImageSize\fastImageSize $imagesize fastImageSize class * @param string $phpbb_root_path Path to the phpBB root * @param string $php_ext PHP file extension * @param \phpbb\path_helper $path_helper phpBB path helper * @param \phpbb\cache\driver\driver_interface $cache Cache driver */ - public function __construct(\phpbb\config\config $config, \phpbb\upload\imagesize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null) + public function __construct(\phpbb\config\config $config, \fastImageSize\fastImageSize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null) { $this->config = $config; $this->imagesize = $imagesize; diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php index 73effadc18..badbd9421d 100644 --- a/phpBB/phpbb/avatar/driver/gravatar.php +++ b/phpBB/phpbb/avatar/driver/gravatar.php @@ -108,7 +108,7 @@ class gravatar extends \phpbb\avatar\driver\driver $row['avatar_width'] = $row['avatar_height'] = min($this->config['avatar_max_width'], $this->config['avatar_max_height']); $url = $this->get_gravatar_url($row); - if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = $this->imagesize->get_imagesize($url)) === false)) + if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false)) { $error[] = 'UNABLE_GET_IMAGE_SIZE'; return false; diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index abb07469de..88a139f81e 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -172,7 +172,7 @@ class local extends \phpbb\avatar\driver\driver // Match all images in the gallery folder if (preg_match('#^[^&\'"<>]+\.(?:' . implode('|', $this->allowed_extensions) . ')$#i', $image) && is_file($file_path . '/' . $image)) { - $dims = $this->imagesize->get_imagesize($file_path . '/' . $image); + $dims = $this->imagesize->getImageSize($file_path . '/' . $image); if ($dims === false) { diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index d04f95905d..90443c9b4e 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -93,7 +93,7 @@ class remote extends \phpbb\avatar\driver\driver } // Get image dimensions - if (($width <= 0 || $height <= 0) && (($image_data = $this->imagesize->get_imagesize($url)) === false)) + if (($width <= 0 || $height <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false)) { $error[] = 'UNABLE_GET_IMAGE_SIZE'; return false; diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index 0582f235e0..e46a0578d2 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -374,8 +374,8 @@ class parser implements \phpbb\textformatter\parser_interface if ($max_height || $max_width) { - $imagesize = new \phpbb\upload\imagesize(); - $size_info = $imagesize->get_imagesize($url); + $imagesize = new \fastImageSize\fastImageSize(); + $size_info = $imagesize->getImageSize($url); if ($size_info === false) { $logger->err('UNABLE_GET_IMAGE_SIZE'); diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 14c88c8da5..638ba0aaff 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -57,7 +57,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case new \phpbb\mimetype\content_guesser, ); $guesser = new \phpbb\mimetype\guesser($guessers); - $imagesize = new \phpbb\upload\imagesize(); + $imagesize = new \fastImageSize\fastImageSize(); // $this->avatar_foobar will be needed later on $this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)); diff --git a/tests/upload/imagesize_test.php b/tests/upload/imagesize_test.php index 2ce712e5c1..bfea4b819d 100644 --- a/tests/upload/imagesize_test.php +++ b/tests/upload/imagesize_test.php @@ -16,7 +16,7 @@ require_once(__DIR__ . '/../../phpBB/includes/functions.php'); class phpbb_upload_imagesize_test extends \phpbb_test_case { - /** @var \phpbb\upload\imagesize */ + /** @var \fastImageSize\fastImageSize */ protected $imagesize; /** @var string Path to fixtures */ @@ -25,7 +25,7 @@ class phpbb_upload_imagesize_test extends \phpbb_test_case public function setUp() { parent::setUp(); - $this->imagesize = new \phpbb\upload\imagesize(); + $this->imagesize = new \fastImageSize\fastImageSize(); $this->path = __DIR__ . '/fixture/'; } @@ -84,7 +84,7 @@ class phpbb_upload_imagesize_test extends \phpbb_test_case */ public function test_get_imagesize($file, $mime_type, $expected) { - $this->assertEquals($expected, $this->imagesize->get_imagesize($this->path . $file, $mime_type)); + $this->assertEquals($expected, $this->imagesize->getImageSize($this->path . $file, $mime_type)); } public function test_get_imagesize_remote() @@ -94,6 +94,6 @@ class phpbb_upload_imagesize_test extends \phpbb_test_case 'height' => 80, 'type' => IMAGETYPE_JPEG, ), - $this->imagesize->get_imagesize('https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg')); + $this->imagesize->getImageSize('https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg')); } } |