mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 19:24:01 +02:00
[ticket/8672] Add class for retrieving imagesize without download
getimagesize() always downloads the complete file before checking the actual image dimensions. This class will be able to do the same without having to download possibly large files. PHPBB3-8672
This commit is contained in:
@@ -57,9 +57,10 @@ 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();
|
||||
|
||||
// $this->avatar_foobar will be needed later on
|
||||
$this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
||||
$this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
||||
$this->avatar_foobar->expects($this->any())
|
||||
->method('get_name')
|
||||
->will($this->returnValue('avatar.driver.foobar'));
|
||||
@@ -74,7 +75,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||
{
|
||||
if ($driver !== 'upload')
|
||||
{
|
||||
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
||||
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user