We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

after resize the image is even more big

$image = new \Phalcon\Image\Adapter\Imagick("test.jpg");

$image->resize(800, 600);

$image->save();


picture 1:

before resize: 66K (1024 * 520)

after resize: 75K (800 * 406)


picture 2:

before resize: 218K (1920 * 1285)

after resize: 338K (800 * 535)

Do i miss something ?



43.9k
edited Sep '15

Hi,

if your on linux; try

sh# convert rose.jpg -resize 800x600 rose.png

this is the command used by ImageMagick to resize images. See if the same happens ...

before resize: 218K (1920 * 1285)

after resize: 38K (800 * 535)

perfect in the command line


what is wrong ?

Hi,

if your on linux; try

sh# convert rose.jpg -resize 800x600 rose.png

this is the command used by ImageMagick to resize images. See if the same happens ...

https://php.net/manual/en/book.imagick.php

$im = new Imagick("test.jpg");

$im->thumbnailImage(800, 600, true);

$im->writeImage("thumb.jpg");


the result is almost the same as the command "convert test.jpg -resize 800x600 thumb.jpg"

so, please check about the phalcon imagick class, maybe this is a bug.



223
edited Jul '19

Looks like an bug

function adaptiveResizeImage($imagePath, $width, $height, $bestFit) { $imagick = new \Imagick(realpath($imagePath)); $imagick->adaptiveResizeImage($width, $height, $bestFit); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); }

where can I see the "adaptiveResizeImage" function ?

Looks like an bug

function adaptiveResizeImage($imagePath, $width, $height, $bestFit) { $imagick = new \Imagick(realpath($imagePath)); $imagick->adaptiveResizeImage($width, $height, $bestFit); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); }


Hi guys! When a student needs an exclusive paper, they will get precisely what they require from Exclusive Paper.com. Every essay, term paper, research paper and dissertation is customized according to your instructions and your professor's demands.