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

Quality for jpges not changing #44

Open
kasparssilins opened this issue Jan 6, 2020 · 9 comments
Open

Quality for jpges not changing #44

kasparssilins opened this issue Jan 6, 2020 · 9 comments

Comments

@kasparssilins
Copy link

Hi, i have this code:
$quality = 80; $image = Image::fromFile($file); $image->autoRotate(); if(!empty($wm)){ $watermark = Image::fromFile($wm); $image->watermark($watermark, $x = 'right', $y = 'bottom'); } $image->quality($quality); $image->resize($w, $h); $image->save($dest);

I can set quality 10 or 90 the image size (in kb) and quality afters save is the same :(

@oscarotero
Copy link
Owner

What library are you using? Gd or Imagick?

@kasparssilins
Copy link
Author

Im not defined library, but i think by default is GD :)

@oscarotero
Copy link
Owner

I've reproduced your code here https://github.com/oscarotero/imagecow/blob/master/example/quality.php
and it works fine to me.

@kasparssilins
Copy link
Author

Ok, i now get it where is problem...
When you change quality and $image -> show(); <--- Yes, quality changed!
but here: $image -> save('low-ress-image.jpg'); <--- Quality not changing..
I hope you understand ;)

@oscarotero
Copy link
Owner

To me, both methods works fine. "low-less-image.jpg" has the same low quality than show()

@kasparssilins
Copy link
Author

To mo save() function not change image quality :(
PHP 7.3, Apache, GD

@kasparssilins
Copy link
Author

@oscarotero
Copy link
Owner

No idea. This code works fine to me (save and show). Are you sure that the new image is really saved in this directory and is the same that is loaded by the html?

@kasparssilins
Copy link
Author

Yes, it's generate new image every time when this url is opened!
This is standard shared hosting, later i will try on my own local server, let's see how this code will work there!
Thanks for your time and response!

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

2 participants