CodeIgniter Forums
image_lib thumbnail quality - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: image_lib thumbnail quality (/showthread.php?tid=5024)



image_lib thumbnail quality - El Forum - 01-01-2008

[eluser]gRoberts[/eluser]
Hi all...

Can anyone see why my thumbnail quality is poo?

I'm not sure how to display images in here, so i've posted the urls:

Source: http://img219.imageshack.us/img219/7695/dockrg8.jpg
Thumbnail: http://img219.imageshack.us/img219/336/e84347ab7e370beab29607eum9.jpg

Another thing i've noticed is that imageshack behaved differently when uploading the Source, it provided a preview and options whereas it didn't with the thumbnail.

Is there something wrong with the thumbnails?

Heres the code that generates it:

Code:
<?php

    /**
     * @author Gavin Roberts
     * @copyright 2007
     */
    
    class thumbGenerator {
                
        public $imageDir;
        private $base;
                
        public function __construct() {
            
            $this->base =& get_instance();
            $this->base->load->library('image_lib');
            
        }
        
        public function generate($source, $output, $width, $height) {
            
            $config['source_image'] = $source;
            $config['maintain_ratio'] = TRUE;
            $config['create_thumb'] = false;
            $config['new_image'] = $output;
            $config['quality'] = 100;
            $config['width'] = (int)$width;
            $config['height'] = (int)$height;
            
            $this->base->image_lib->initialize($config);
            if(!$this->base->image_lib->resize())
                die($this->base->image_lib->display_errors());
            
        }
        
        public function applyWatermark($to, $watermark) {
            
            $config['source_image'] = $to;
            $config['wm_type'] = 'overlay';
            $config['quality'] = 100;
            $config['wm_overlay_path'] = $watermark;
            $config['wm_opacity'] = 50;
        
            $this->base->image_lib->initialize($config);
            return $this->base->image_lib->watermark();
            
        }
        
    }

?>

Any help is appreciated!

HAPPY NEW YEAR!!!


image_lib thumbnail quality - El Forum - 01-06-2008

[eluser]Grahack[/eluser]
I guess you have options because the file and its image is big. The thumbnail is small so the site assumes you don't need any further processing.
Now back to the original problem: I really don't know!!!