Welcome Guest, Not a member yet? Register   Sign In
image_lib thumbnail quality
#1

[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/e...07eum9.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!!!


Messages In This Thread
image_lib thumbnail quality - by El Forum - 01-01-2008, 04:40 AM
image_lib thumbnail quality - by El Forum - 01-06-2008, 04:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB