Welcome Guest, Not a member yet? Register   Sign In
File Uploading Library. Error if image < 300 pixels?
#8

[eluser]Flynn[/eluser]
Keep this:

Code:
function set_min_height($n)
    {
        $this->min_height = ((int) $n < 0) ? 0: (int) $n;
    }

    function set_min_width($n)
    {
        $this->min_width = ((int) $n < 0) ? 0: (int) $n;
    }

And add this at the beginning:

Code:
function initialize($config = array())
    {
        $defaults = array(
                            'max_size'            => 0,
                            'max_width'            => 0,
                            'max_height'        => 0,
                            'max_filename'        => 0,
                            'min_width'            => 0,
                            'min_height'            => 0,
                            'allowed_types'        => "",
                            'file_temp'            => "",
                            'file_name'            => "",
                            'orig_name'            => "",
                            'file_type'            => "",
                            'file_size'            => "",
                            'file_ext'            => "",
                            'upload_path'        => "",
                            'overwrite'            => FALSE,
                            'encrypt_name'        => FALSE,
                            'is_image'            => FALSE,
                            'image_width'        => '',
                            'image_height'        => '',
                            'image_type'        => '',
                            'image_size_str'    => '',
                            'error_msg'            => array(),
                            'mimes'                => array(),
                            'remove_spaces'        => TRUE,
                            'xss_clean'            => FALSE,
                            'temp_prefix'        => "temp_file_"
                        );    
    
    
        foreach ($defaults as $key => $val)
        {
            if (isset($config[$key]))
            {
                $method = 'set_'.$key;
                if (method_exists($this, $method))
                {
                    $this->$method($config[$key]);
                }
                else
                {
                    $this->$key = $config[$key];
                }            
            }
            else
            {
                $this->$key = $val;
            }
        }
    }

I think that'll do the work.


Messages In This Thread
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-18-2010, 12:30 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-18-2010, 05:25 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-18-2010, 06:38 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-18-2010, 09:59 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-19-2010, 05:42 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-28-2010, 11:19 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-28-2010, 11:33 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-28-2010, 11:55 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-28-2010, 02:25 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 08-29-2010, 04:29 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 09-25-2010, 01:00 PM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 09-30-2010, 03:57 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 09-30-2010, 04:10 AM
File Uploading Library. Error if image < 300 pixels? - by El Forum - 07-05-2012, 04:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB