Jump to content
jjjefersonnn

reduces image quality?

Recommended Posts

jjjefersonnn

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
Robert

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
jjjefersonnn

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

Share this post


Link to post
Share on other sites
Robert

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
jjjefersonnn

I found it

 

app>multiFunctions.inc

line 2724

            $bigThumb->setParameter('q', 95);
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. policies