rifanece / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

png quality incorrect #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In function "show_image" the quality setting for png is incorrect. For some 
reason png quality (0-9) 
differs from jpg quality (0-100).  With jpg 100 is the best quality, with png 0 
is the best quality.

Here is the fix I used that works.

    elseif( stristr( $mime_type, 'png' ) ) {
        $quality = round((100 - $quality)/10);
        $quality = ($quality==10) ? 9 : $quality;
        imagepng( $image_resized, $cache_file_name, $quality );
    }

Original issue reported on code.google.com by mike.bu...@gmail.com on 4 Oct 2008 at 9:40

GoogleCodeExporter commented 8 years ago
Thanks for the note - I've made the changes and updated the code.

Original comment by BinaryMoon on 22 Oct 2008 at 3:45