Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] Remove the createThumbs function in the image class #44663

Open
wants to merge 1 commit into
base: 6.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions libraries/src/Image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,27 +367,6 @@ public function createThumbnails($thumbSizes, $creationMethod = self::SCALE_INSI
return $thumbsCreated;
}

/**
* Method to create thumbnails from the current image and save them to disk. It allows creation by resizing or cropping the original image.
*
* @param mixed $thumbSizes string or array of strings. Example: $thumbSizes = ['150x75','250x150'];
* @param integer $creationMethod 1-3 resize $scaleMethod | 4 create cropping
* @param string $thumbsFolder destination thumbs folder. null generates a thumbs folder in the image folder
*
* @return array
*
* @since 2.5.0
* @throws \LogicException
* @throws \InvalidArgumentException
*
* @deprecated 4.0 will be removed in 6.0
* Use \Joomla\CMS\Image\createThumbnails instead
*/
public function createThumbs($thumbSizes, $creationMethod = self::SCALE_INSIDE, $thumbsFolder = null)
{
return $this->createThumbnails($thumbSizes, $creationMethod, $thumbsFolder, false);
}

/**
* Method to crop the current image.
*
Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/Libraries/Cms/Image/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,27 +884,27 @@ public function testGenerateThumbs()
}

/**
* Test the Image::createThumbs method without a loaded image.
* Test the Image::createThumbnails method without a loaded image.
*
* @return void
*
* @covers \Joomla\CMS\Image\Image::createThumbs
* @covers \Joomla\CMS\Image\Image::createThumbnails
*
* @since 1.1.3
*/
public function testCreateThumbsWithoutLoadedImage()
public function testcreateThumbnailsWithoutLoadedImage()
{
$this->expectException(\LogicException::class);

$thumbs = $this->instance->createThumbs('50x38');
$thumbs = $this->instance->createThumbnails('50x38');
}

/**
* Test the Image::generateThumbs method with invalid folder.
*
* @return void
*
* @covers \Joomla\CMS\Image\Image::createThumbs
* @covers \Joomla\CMS\Image\Image::createThumbnails
*
* @since 1.1.3
*/
Expand All @@ -913,23 +913,23 @@ public function testGenerateThumbsWithInvalidFolder()
$this->expectException(\InvalidArgumentException::class);

$this->instance->loadFile($this->testFile);
$this->instance->createThumbs('50x38', Image::SCALE_INSIDE, '/foo/bar');
$this->instance->createThumbnails('50x38', Image::SCALE_INSIDE, '/foo/bar');
}

/**
* Test the Image::createThumbs method.
* Test the Image::createThumbnails method.
*
* @return void
*
* @covers \Joomla\CMS\Image\Image::createThumbs
* @covers \Joomla\CMS\Image\Image::createThumbnails
*
* @since 1.1.3
*/
public function testCreateThumbs()
public function testcreateThumbnails()
{
$this->instance->loadFile($this->testFile);

$thumbs = $this->instance->createThumbs('50x38', Image::CROP);
$thumbs = $this->instance->createThumbnails('50x38', Image::CROP);
$outFileGif = TestHelper::getValue($thumbs[0], 'path');

$a = Image::getImageFileProperties($this->testFile);
Expand Down