So I wrote this coding:
It works, but there are several issues:
Code: Select all
$image = new Imagick(); $image->readImage(__DIR__ . DIRECTORY_SEPARATOR . $normalfile); $image->setImageFormat("png"); $image->resizeImage(100, 100, imagick::FILTER_LANCZOS, 1); $image->writeImage(__DIR__ . DIRECTORY_SEPARATOR . $thumbfile. ".png");
- The image ain't resized at all (it still has it's original width and height)
- The vector drawing is often not centered (not in the middle of the png file)
- Sometimes a part of the vector drawing isn't in the created png file.
The idea is to create a png file with the whole vector drawing centered in it and that the vector drawing fills up the created png file.
I'm a complete imagemagick noob, so I hope someone can help me out.