Click to See Complete Forum and Search --> : Dynamic Thumbnail Creation


drawmack
11-23-2003, 08:38 PM
Attached is a file that contains the code to resize an image to a thumbnail. I did this up in tutorial format because I couldn't find a good tutorial on the subject. Here it is for comment, critique and dismemberment.


Updated the script with a bug fix and the changes suggested by moonglobe.

planetsim
11-24-2003, 06:00 AM
Maybe you should add an automatic folder creator within it. I had an error thinking it would work first time. But other than that its not bad at all. Though i suggest you use move_uploaded_file instead of copy because some systems have safe mode on. But im sure this wont be used as anything else but just test and learning experience..

Nice stuff

drawmack
11-24-2003, 12:47 PM
Thanks planet, I'll implement the changes you suggest and repost the new version.

KITTfan2K
11-24-2003, 12:52 PM
Originally posted by planetsim
Though i suggest you use move_uploaded_file instead of copy because some systems have safe mode on. But im sure this wont be used as anything else but just test and learning experience..

Nice stuff

Are you actually allowed to upload files when safe mode is on?

KITTfan2K

planetsim
11-25-2003, 03:35 AM
Yes it works read it on here

http://www.php.net/manual/en/function.move-uploaded-file.php It repeats itself twice about it working with safemode enabled

KITTfan2K
11-25-2003, 05:22 AM
Originally posted by planetsim
Yes it works read it on here

http://www.php.net/manual/en/function.move-uploaded-file.php It repeats itself twice about it working with safemode enabled

I mean, if Safe Mode was on, would the file be uploaded correctly, before we get to moving it...

I think that Invision File Manager says that safe mode restricts the uploading of files.

KITTfan2K

Moonglobe
11-25-2003, 12:51 PM
isn't it rather stupid using error_reporting(E_ALL) and then using all those @ signs?

planetsim
11-25-2003, 06:25 PM
KITTfan2K just to answer your question, ive used move_uploaded_file many times on safe mode, i actually work with my current settings with safe_mode = on, just because of the restrictions it gives. The only way that move_uploaded_file will not work is if the function was disabled, other than that it works practically the just about the same other than it works in safe mode regardless

drawmack
11-26-2003, 12:09 AM
Originally posted by Moonglobe
isn't it rather stupid using error_reporting(E_ALL) and then using all those @ signs?

ooppss forgot to take the E_ALL out I use that for testing but it shouldn't be in production code cause it slows it down.

Moonglobe
11-26-2003, 12:11 AM
i dont see how..... and if it does its more infinitismal than the differene between ' and " for most things. however if you can use E_ALL and have no errors on a production box, you have some pretty solid code.

(of course noone should be displaying errors, only logging them for production)

drawmack
11-27-2003, 11:51 PM
I do my absolute best to generate no errors in production code. My errors in production code are emailed to a mailbox that is linked to my beeper so my beeper goes off every time one of my production sites generates an error. That's what I call motivation to not generate errors.