Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6133939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:17:36+00:00 2026-05-23T17:17:36+00:00

I am working on a script that downloads a file from Dropbox, supposed to

  • 0

I am working on a script that downloads a file from Dropbox, supposed to resize that image and then shoot it up to an S3 bucket.

For some reason, I can’t get the image to resize.

I keep getting the following error:
The path to the image is not correct.
Your server does not support the GD function required to process this type of image.

Code Base:

public function resize_test() {
            $postcard_assets = $this->conn->getPostcardDirContent("folder_name", "Photos", TRUE);

            foreach($postcard_assets['contents'] as $asset) {
                $file = pathinfo($asset['path']);
                $original_file = $this->conn->downloadFile($asset['path']);

                $raw_file = sha1($file['basename']);
                $s3_file_name = "1_{$raw_file}.{$file['extension']}";
                $this->resize_photo($original_file);
                $this->s3->putObject($s3_file_name, $original_file, 's3-bucket-name', 'public-read');

                $s3_check = $this->s3->getObjectInfo($s3_file_name, 's3-bucket-name');

                if($s3_check['content-length'] > 0) {
                    krumo($s3_check);
                    exit();
                }
            }
        }

private function resize_photo($photo) {
            $config['image_library'] = 'imagemagick';
            $config['source_image'] = $photo;
            $config['maintain_ratio'] = TRUE;
            $config['width']     = 640;
            $config['height']   = 480;

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

            if(!$this->image_lib->resize()) {
                exit($this->image_lib->display_errors());
            }
        }

Dropbox API DownloadFile:

    public function downloadFile($file) {
        $this->setTokens();
        return $this->conn->getFile($file);
    }

Anyone know what I might be doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:17:37+00:00Added an answer on May 23, 2026 at 5:17 pm

    Dont load image_lib multiple times. Add image_lib in autoload libs and change

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

    to

    $this->image_lib->initialize($config);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a script in PHP that needs to get some info from
I'm working with a VB Script file written by someone else that uses Windows
I am working on a script that will process user uploads to the server,
I am working on a javascript app that users load via a configurable script
In tcsh , I have the following script working: #!/bin/tcsh setenv X_ROOT /some/specified/path setenv
I am working on a bash script where I need to conditionally execute some
I found a little script that will export information to an xls file, but
I'm working on a simple GUI Python script to do some simple tasks on
I am creating a script on the fly to ftp some files from a
I have a php script that I have used for years to force downloads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.