Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very low quality of resulting images on Windows #338

Open
mihail-minkov opened this issue May 17, 2022 · 0 comments
Open

Very low quality of resulting images on Windows #338

mihail-minkov opened this issue May 17, 2022 · 0 comments

Comments

@mihail-minkov
Copy link

First of all, great library, really easy to use and also fast!

This is not a critical issue but it does cause me some complications on my local server.

I have the following setup:

  • Windows 10
  • Apache 2.4.25
  • PHP 7.4.11

I am using CodeIgniter 4.1.9 and WebpConvert 2.9.1 which I think is the latest version as per this post.

So, I use the following code:

$fuente = '1200x500_processed_file.jpg';
$destino = 'uploades/1200x500_processed_file.webp';
$opciones = [
    'converters' => ['gd'],
    'png' => [
        'encoding' => 'auto',    
        'near-lossless' => 60,   
        'quality' => 85,         
        'sharp-yuv' => true,
    ],
    'jpeg' => [
        'encoding' => 'auto',    
        'quality' => 'auto',     
        'max-quality' => 80,     
        'default-quality' => 75, 
        'sharp-yuv' => true,
    ]
];
WebPConvert::convert($fuente, $destino, $opciones);

If I use this on Ubuntu it works like a charm, but when I use it on Windows it completely ignores the quality settings and inputs extremely low quality images:

The JPG is previously compressed and resized accordingly, but as you can see in the example, the difference in quality is enormous.

Example:

Original processed JPG - 7.48 kb
image

Webp converted file from the original JPG - 588 bytes
image

Is there some issue with the library and Windows or am I configuring something incorrectly? I tried using imagemagick as a converter but I get PHP errors, that might be a config issue from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant