trippo / ResponsiveFilemanager

Completely Responsive Filemanager with integration for tinyMCE,CKEditor and CLEditor editor
http://responsivefilemanager.com
Other
808 stars 368 forks source link

Question: Is there a way to change image quality? #681

Closed ghost closed 2 years ago

ghost commented 2 years ago

I'm trying to change jpeg and webp image quality from 75 to 90.

I have changed this lines of UploadHandler.php and set to 50, 75, 90, even to 100.

https://github.com/trippo/ResponsiveFilemanager/blob/master/filemanager/UploadHandler.php#L730 https://github.com/trippo/ResponsiveFilemanager/blob/master/filemanager/UploadHandler.php#L747

But, when I uploeded the image, it ignores my settings and here my results.

Original image: myfile

Quality 50: q50

Quality 75: q75

Quality 100: q100

Is it related with my php settings. Or am I triyng to change the wrong file?


PHP Version => 8.0.14
GD Support => enabled
GD headers Version => 2.3.0
GD library Version => 2.3.0
FreeType Support => enabled
FreeType Linkage => with freetype
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
PNG Support => enabled
WBMP Support => enabled
XPM Support => enabled
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
TGA Read Support => enabled
ghost commented 2 years ago

Hımm, I think I found a way.

I changed these lines to 90.

https://github.com/trippo/ResponsiveFilemanager/blob/8dacbc4587d83cfece50609f0a2b80d42bcb7405/filemanager/include/php_image_magician.php#L2833

https://github.com/trippo/ResponsiveFilemanager/blob/8dacbc4587d83cfece50609f0a2b80d42bcb7405/filemanager/include/php_image_magician.php#L2844

But, instead of hack, IMHO, there should be a setting for this.