jjjefersonnn Posted November 9, 2016 Share Posted November 9, 2016 (edited) Anyone knows someway to reduces image quality? (not resize) ....... Its good to save some bandwidth This possible with the thumbnails, but I havent found a way to do it with the images Edited November 9, 2016 by jjjefersonnn Link to comment Share on other sites More sharing options...
Robert Posted November 10, 2016 Share Posted November 10, 2016 Try this. Open the file /app/functions.inc.php On, or about, line #614, locate the following routine: if ( $t == 1 ) { $img_src = imagecreatefromjpeg( $sourcefile ); $img_dst = imagecreatetruecolor( $iw, $ih ); imagecopyresampled( $img_dst, $img_src, 0, 0, 0, 0, $iw, $ih, $is[0], $is[1] ); if( !imagejpeg( $img_dst, $destfile, 95 ) ) { exit( ); } } Change it to this: if ( $t == 1 ) { $img_src = imagecreatefromjpeg( $sourcefile ); $img_dst = imagecreatetruecolor( $iw, $ih ); imagecopyresampled( $img_dst, $img_src, 0, 0, 0, 0, $iw, $ih, $is[0], $is[1] ); if( !imagejpeg( $img_dst, $destfile, 90 ) ) { exit( ); } } Note the slight difference. The original value is "95" for image quality. In the second example, I changed it to 90. Save it Backup your original file, then upload the newly saved one. You may need to do some trial and error to figure out the best blend of quality versus file size. Let me know if that works for you. I'm not sure if that's it or not. I just took an educated guess from a quick look, but I think that's where you can change the value of the resampled images. Link to comment Share on other sites More sharing options...
jjjefersonnn Posted November 10, 2016 Author Share Posted November 10, 2016 Doesnt work..... I tryed to put $destfile, 50 to see a really good change, but nothing happens... the files keep the same size/quality as before Link to comment Share on other sites More sharing options...
Robert Posted November 10, 2016 Share Posted November 10, 2016 Hmm, ok, I'll have to look closer -- I'll try to get to it a bit later today. But my guess is one of the routines then in the general functions, perhaps the "Queue" file will have hardcoded image quality values. So you might want to look there. I would start looking for hardcoded quality settings of 90 to 95 in the files, using searches for things like "truecolor", "resampled", "imagecreate" etc -- the ones that would be local commands for imagemagick Link to comment Share on other sites More sharing options...
jjjefersonnn Posted November 10, 2016 Author Share Posted November 10, 2016 I found it app>multiFunctions.inc line 2724 $bigThumb->setParameter('q', 95); Link to comment Share on other sites More sharing options...
Robert Posted November 10, 2016 Share Posted November 10, 2016 Perfect. Thanks for the info. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now