User tests: Successful: Unsuccessful:
If you crop-resize an image and choose set the $createNew Parameter to true, the original image will be resized nevertheless.
The patch fixes this error.
Test:
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Any extension/code we could test with?
Hello,
you could test with something like that:
// Load a large image (at least 800x600 and a JPG)
$absolute_path_to_image = JPATH_BASE . '/images/my/image.jpg';
$baseimage = new JImage($absolute_path_to_image);
$sizes = array();
$sizes[] = '50x50';
$sizes[] = '600x450';
// Create images in a subfolder "thumbs"
$baseimage->createThumbs($sizes, JImage::CROP_RESIZE);
$new_absolute_path = JPATH_BASE . '/images/my/new_image.jpg';
$baseimage->toPath($new_absolute_path);
You have to replace $absolute_path_to_image
and $new_absolute_path
with your paths to the image and where the new image should be saved.
Expected results:
$new_absolute_path
) should be unchanged to the original image ($absolute_path_to_image
).Actual result:
=> Apply patch and try again
(You can test this with only the 50x50 size and then saving ->toFile(...)
so see the error.)
I did something like this;
// Original image dimensions: 300 x 62
$image = new JImage(__DIR__ . '/logo.png');
echo 'Original image bevore cropResize: Width: ' . $image->getWidth() . ' Height: ' . $image->getHeight();
// Output without patch: Original image before cropResize: Width: 300 Height: 62
// Output with patch: Original image before cropResize: Width: 300 Height: 62
$newImage = $image->cropResize(150, 31, true);
echo ' | Original image after cropResize: Width: ' . $image->getWidth() . ' Height: ' . $image->getHeight();
// Output without patch: Original image after cropResize: Width: 150 Height: 31
// Output with patch: Original image after cropResize: Width: 300 Height: 62
Status | Pending | ⇒ | Ready to Commit |
I can reproduce the bug and the patch fixes it!
We have 4 successful tests, moving to RTC.
Thank you for you contribution, @bembelimen!
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Folks, when you move to RTC, make sure it is also set to RTC in github
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-09-25 13:44:07 |
Milestone |
Added: |
@test - fixes the issue, nice find.