• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image manipulation woes, currently producing blank images

#21
[eluser]Robert May[/eluser]
Thanks coffeebean, I'll have a look at it later today. :-)

#22
[eluser]Robert May[/eluser]
I've given it a go, and I've skipped the upload function because I'm processing that separately, but I can't seem to get it to work. It creates a thumbnail file, but it's the same size as the original, and the original isn't scaled down to the max size. Here's how I've implemented it:

Code:
foreach($fileArray as $file){

                $aFile = explode('=', $file);

                $aFile = $aFile[1];

                

                $sourceimage = $_SERVER['DOCUMENT_ROOT'].'/gallery/'.$aFile;



                $minusExtension = explode('.', $aFile, 2);

                $filename  = $minusExtension[0];

                $extension = $minusExtension[1];

                $thumbnail = $filename.'_thumb.'.$extension;

                $squarethumb = $filename.'_squarethumb.'.$extension;

                

                // Make squarethumb

                $data = GetImageSize($sourceimage, $info);

                $img_x = $data[0];

                $img_y = $data[1];

                $img_type  = $data[2];

                  $img_sizes = $size[3];

                $channels = $data['channels'];

                $bits = $data['bits'];

                $mime = $data['mime'];

                $config['image_library']   = 'GD2';

                $config['thumb_size']        = 200;

                $config['image_height']    = 500;

                $config['image_width']     = 600;

                

                $data['file_name']    = $aFile;

                $data['file_type']    = $img_type;

                $data['file_path']    = $_SERVER['DOCUMENT_ROOT'].'/gallery/';

                $data['full_path']    = $_SERVER['DOCUMENT_ROOT'].'/gallery/'.$aFile;

                $data['thumb_name']   = $squarethumb;

                $data['raw_name']     = $filename;

                $data['file_ext']     = '.'.$extension;

                $data['file_size']    = $bits;

                $data['is_image']     = 1;

                $data['image_width']  = $img_x;

                $data['image_height'] = $img_y;

                $data['image_type']   = $img_type;    

                

                $this->load->library('ImgLib');

                if(!$this->imglib->process_image($data)){

                    echo "Error manipulating the image";

                }

                else {                

                    $data = $this->gallery_model->add_image($aFile);

                }

            }

Have I missed something out? Your code looks good, so I'm assuming I've missed something out.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.