We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Problems with file loading

Development and Programming

nginx's avatar
nginx
1 posts
11 years ago
nginx's avatar nginx

hi guys, I’ve got a problem when I’m trying to load several files and then to process them with library(‘image_lib’). The goal is - user downloads 3 files(photos) with any size, then program processes them and compress to the following size/quality and save in a folder. So when I do that- program saves 3 initial user’s files and then create only one compressed copy insted of 3. I tried to resolve that problem all the day long but without any result. Attach the following code.

$config['upload_path'] = './images/';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['file_name'] = 'pic';
            $this->load->library('upload', $config);
            $this->upload->do_upload('image_name');
            $arr1=$this->upload->data();
            $config = array(
                'image_library' => 'gd2',
                'quality' => '50',
                'source_image' => $arr1['full_path'],
                'new_image' => './images/i',
                'maintain_ratio' => true,
                'create_thumb' => false,
                'width' => 700,
                'height' => 500
            );
            $this->load->library('image_lib', $config);

            $this->image_lib->resize();
            $config['upload_path'] = './images/';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['file_name'] = 'pic2';
            $this->load->library('upload', $config);
            $this->upload->do_upload('image_name2');
            $arr2=$this->upload->data();
            $config = array(
                'image_library' => 'gd2',
                'quality' => '50',
                'source_image' => $arr2['full_path'],
                'new_image' => './images/i',
                'maintain_ratio' => true,
                'create_thumb' => false,
                'width' => 700,
                'height' => 500
            );
            $this->load->library('image_lib', $config);

            $this->image_lib->resize();
            $config['upload_path'] = './images/';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['file_name'] = 'pic3';
            $this->load->library('upload', $config);
            $this->upload->do_upload('image_name3');
            $arr3=$this->upload->data();
            $config = array(
                'image_library' => 'gd2',
                'quality' => '50',
                'source_image' => $arr3['full_path'],
                'new_image' => './images/i',
                'maintain_ratio' => true,
                'create_thumb' => false,
                'width' => 700,
                'height' => 500
            );
            $this->load->library('image_lib', $config);

            $this->image_lib->resize();
       
nginx's avatar
nginx
1 posts
11 years ago
nginx's avatar nginx

Guys really no thoughts?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.