php - Resizing an image on the fly using CodeIgniter -


I am working on a script that downloads a file from the dropbox, which should resize the image and Then it should shoot at the S3 bucket.

For some reason, I can not change the image in size.

I am getting the following error:
The path of the image is not the right thing. Your server does not support the required GD Function to process this type of image.

Code base:

  public function resize_test () {$ Postcard_assets = $ this- & gt; Conn- & gt; GetPostcardDirContent ("folder_name", "photo", correct); Foreign currency ($ postcard_assets ['content'] $ assets) {$ file = pathinfo ($ asset ['path']); $ Original_file = $ this- & gt; Conn- & gt; Download file ($ property ['path']); $ Raw_file = sha1 ($ file ['basename']); $ S3_file_name = "1 _ {$ raw_file}. {$ File ['extension']}"; $ This- & gt; Resize_photo ($ original_file); $ This- & gt; S3- & gt; PutObject ($ s3_file_name, $ original_file, 's3-bucket-name', 'public-read'); $ S3_check = $ this- & gt; S3- & gt; GetObjectInfo ($ s3_file_name, 's3-bucket-name'); ($ S3_check ['content-length']> gt; {krumo ($ s3_check); exit ();}}} personal function resize_photo ($ photo) {$ config ['image_library'] = 'imagemagic'; $ Config ['source_image'] = $ photo; $ Config ['maintain_ratio'] = true; $ config ['width'] = 640; $ config ['height'] = 480; $ this-> load-> gt; ; Library ('image_lib', $ config); if (! $ This-> image_lib- & gt; resizing ()) {exit ($ this-> image_lib-> display_errors ());} }   

Dropbox API Download File:

  Public Function Download File ($ file) {$ this-> SetTockens (); Return $ the -> gt; conn- & gt; getFile ($ file);}   

What's wrong with me?

Do not load images_lib too many times. Autoload libs in image_lib Add and

  $ this-> Load-> Library ('image_lib', $ config);   

to < Pre> $ this-> image_lib- & gt; Start ($ config);

Comments