rosell-dk / webp-convert

Convert jpeg/png to webp with PHP (if at all possible)
MIT License
578 stars 102 forks source link

Image Conversion: Taking too much memory #253

Closed lizeshakya closed 3 years ago

lizeshakya commented 4 years ago

Hello, I am using this package to convert the jpeg, jpg, png image to webp format. The project is hosted in the shared CPanel having 1 Gigs of Physical Memory. While converting the image, it is taking so much memory (~634 MB) for 1.19 MB file. And after 103 seconds, it returns me the error page like:

Capture1

The code I used is: \WebPConvert\WebPConvert::convert(public_path($fullImagePath), public_path($thumbImagePath), [ 'quality' => 50, 'low-memory' => true ]);

Memory Usage Image: Capture

Where did I go wrong? Is it normal or I did something wrong? I cannot figure it out.

S1SYPHOS commented 4 years ago

Can you determine / tell which conversion method is used, eg imagick, gd, cwebp, .. ?

rosell-dk commented 3 years ago

Closing because of inactivity. Feel free to reopen if you have any new information

dreiren commented 3 years ago

Hi @rosell-dk,

I experienced this in Magento framework with thousands of images. There are so many processes with this command cwebp-110-linux-x86-64 and it eating to much of my server memory. Does it have to do with GD version that the server is using? I only have this copied from htop monitoring tool "rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-110-linux-x86-64 -metadata none -q 75 -alpha_q 85 -near_lossless 60 -sharp_yuv".