SeNioR-January 26 in Developer Connection
Hey, devs. I have a question about converting image attachments.
So, if we use Imagick, PNG images are not compressed at all. 8 out of 10 images that I uploaded to the post have a larger file size than before uploading (lol).
I wrote some code to compress PNG images (by changing the format to webp) and the size dropped by about 80% (sic!), however I need code to save the output file in .webp format.
Can anyone direct me how to change the output format after uploading?
/* Get Format */
$format = $this->imagick->getImageFormat();
/* Set PNG */
if( mb_strtolower( $format ) == 'png' )
$this->imagick->setImageCompressionQuality( 85 );
Started March 22
Started May 10
Started February 26, 2019