Relative Content

Tag Archive for phpimagick

Imagick creating PDF even though setImageFormat is set to JPEG

I have an odd issue that I cannot get to the bottom of. I’m using Imagick to generate JPG thumbnails of PDFs that are uploaded to a custom admin tool. However, Imagick is creating PDF files even though setImageFormat is set to JPEG and to add to the confusion this only happens when a PDF file has a single page. If it’s a multipage PDF, the jpg thumbnails are created.

Imagick causing images to become larger

I have a javascript canvas that I convert to blob using image/webp and a quality of 0.25.
This canvas blob is then posted to my php which loads the image into Imagick and does virtually nothing (so far), but the image goes from 269Kb to 357Kb in size – what is happening here and how can I prevent this?

Poor performance for Imagick DISTORTION_PERSPECTIVE on large images

I am manipulating large hi-res jpeg/webp images (2457 x 4032) to apply $imagick->distortImage(Imagick::DISTORTION_PERSPECTIVE, $coords, false); using PHP8 to fix perspectives – but I am finding this runs very slowly (+10 seconds in a localhost centos7 linux and +15 seconds on a shared host linux). (This is being seen over most images so this is not just an outlier).