File Uploading Library. Error if image < 300 pixels? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: File Uploading Library. Error if image < 300 pixels? (/showthread.php?tid=33201) Pages:
1
2
|
File Uploading Library. Error if image < 300 pixels? - El Forum - 08-18-2010 [eluser]Sinclair[/eluser] Hi, I need to display an error if the image is < than 300 pixels. Which is the best way of doing this? Sorry for my bad english. Best Regards, File Uploading Library. Error if image < 300 pixels? - El Forum - 08-18-2010 [eluser][254]Prof[/eluser] You can add it as a rule when you load the File Uploading Library: Code: $config['max_width'] = 300; In your view, add: Code: if (isset($error)) echo $error; File Uploading Library. Error if image < 300 pixels? - El Forum - 08-18-2010 [eluser]Sinclair[/eluser] Hi, thanks for the reply. I don't want to pop up an error if the max_width is larger than 300 pixels. I need to do the opposite. I need the display error if the size is less than 300 pixels. I think I must to extend the Upload Library. Correct? Best Regards, File Uploading Library. Error if image < 300 pixels? - El Forum - 08-18-2010 [eluser][254]Prof[/eluser] Sorry, I had misunderstood the question. I think you will have to extend the Upload library Kind regards File Uploading Library. Error if image < 300 pixels? - El Forum - 08-19-2010 [eluser]Sinclair[/eluser] Hi, I'm trying to extend the Upload Library to pop up an Error when images have less than X pixels. Code: <?PHP I have this until now. What I need to do more to get this extend working. And wich is the best way of doing this extend without broke the CI compatibility? Best Regards, File Uploading Library. Error if image < 300 pixels? - El Forum - 08-28-2010 [eluser]Flynn[/eluser] Try this one instead of function is_allowed_min_dimensions Code: function is_allowed_dimensions() File Uploading Library. Error if image < 300 pixels? - El Forum - 08-28-2010 [eluser]Sinclair[/eluser] Hi, thanks for the reply. And how to add the "min_width" and the "min_height" to the config file? To the "max_width" and "max_height" we use: Code: $config['max_width'] = 7000; How to add this config lines to the "min_width" and the "min_height"? Best Regards, File Uploading Library. Error if image < 300 pixels? - El Forum - 08-28-2010 [eluser]Flynn[/eluser] Keep this: Code: function set_min_height($n) And add this at the beginning: Code: function initialize($config = array()) I think that'll do the work. File Uploading Library. Error if image < 300 pixels? - El Forum - 08-28-2010 [eluser]juanvillegas[/eluser] Good job! But are you sure no one has already extend this? Maybe some google would save you some coding hours File Uploading Library. Error if image < 300 pixels? - El Forum - 08-29-2010 [eluser]Flynn[/eluser] Well, i wasn't in the mood to dig google and i was sure that it wouldn't take much time to extend library with "minimum check". It took only 5-10 minutes to check what is where and extend it. |