Welcome Guest, Not a member yet? Register   Sign In
Image Manipulation Class and GoDaddy
#1

[eluser]Unknown[/eluser]
Hello all!

I just moved a perfectly working application over to GoDaddy's shared hosting, and I'm suddenly running into some issues with CI's Image Manipulation Class - particularly the watermarking feature.

I've verified that all paths are correct, and that the images are uploading correctly, but when it gets to the watermarking, it fails. Here's the basic uploading code:

Code:
function upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '0';
        $config['max_width']  = '0';
        $config['max_height']  = '0';

        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            $this->load->view('photo_add', $error);
        }    
        else
        {
            $upload = $this->upload->data();
            $image_path = $upload['file_name'];
            $image_width = $upload['image_width'];
            $image_height = $upload['image_height'];
            
            $this->db->set('account_id', $this->User_model->get_account($this->session->userdata('user_id')));
            $this->db->set('user_id', $this->session->userdata('user_id'));
            $this->db->set('album_id', $this->input->post('album_id'));
            $this->db->set('image_path', $image_path);
            $this->db->set('date_added', now());
            $this->db->set('active', true);
            $insert = $this->db->insert('photos');
            
            /// RESIZE PHOTOS AND WATERMARK
            $config['image_library'] = 'GD2';
            $config['source_image'] = '/home/content/14/6993514/html/account/uploads/'.$image_path;
            $config['create_thumb'] = FALSE;
            $config['maintain_ratio'] = TRUE;
            $config['master_dim'] = 'auto';
            $config['width'] = 2100;
            $config['height'] = 1500;
            $config['quality'] = 100;
            $config['wm_type'] = 'overlay';
            $config['wm_overlay_path'] = '/home/content/14/6993514/html/account/watermarks/trulucks.png';
            $config['wm_vrt_alignment'] = 'bottom';
            $config['wm_hor_alignment'] = 'right';
            $config['wm_padding'] = '-65';
            $config['wm_opacity'] = '100';

            $this->load->library('image_lib', $config);

            $this->image_lib->resize();
            $this->image_lib->watermark();
            
            /// CREATE SUCCESS MESSAGE AND REDIRECT BACK TO THE PHOTO ALBUM
            $this->session->set_flashdata('msg','<div class="success"><p>Yay! The Image Was Successfully Uploaded!</p></div>');
            redirect('photos/index/'.$this->input->post('album_id'),'redirect');
        }
    }


And the error message that I'm receiving is:


Code:
A PHP Error was encountered
Severity: Warning
Message: imagecolorat(): supplied argument is not a valid Image resource
Filename: libraries/Image_lib.php
Line Number: 943

A PHP Error was encountered
Severity: Warning
Message: imagecolorat(): supplied argument is not a valid Image resource
Filename: libraries/Image_lib.php
Line Number: 955

A PHP Error was encountered
Severity: Warning
Message: imagecolortransparent(): supplied argument is not a valid Image resource
Filename: libraries/Image_lib.php
Line Number: 955

A PHP Error was encountered
Severity: Warning
Message: imagecopymerge(): supplied argument is not a valid Image resource
Filename: libraries/Image_lib.php
Line Number: 956

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/content/14/6993514/html/domains/delish_photos/account/system/libraries/Exceptions.php:164)
Filename: libraries/Session.php
Line Number: 662

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/content/14/6993514/html/domains/delish_photos/account/system/libraries/Exceptions.php:164)
Filename: helpers/url_helper.php
Line Number: 530

I've also tried all "Image Library types" and the errors persist. Any help is greatly appreciated!


Messages In This Thread
Image Manipulation Class and GoDaddy - by El Forum - 11-12-2010, 12:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB