Jump to content
jjjefersonnn

reduces image quality?

Recommended Posts

Anyone knows someway to reduces image quality? (not resize) ....... Its good to save some bandwidth :D

This possible with the thumbnails, but I havent found a way to do it with the images

Edited by jjjefersonnn

Share this post


Link to post
Share on other sites

Try this.

  1. Open the file /app/functions.inc.php
  2. 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( );
            }
        }
  3. 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.

  4. Save it
  5. Backup your original file, then upload the newly saved one.
  6. You may need to do some trial and error to figure out the best blend of quality versus file size.
  7. 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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×