I want to be able to allow users to upload images to my website via a php script, while taking appropriate actions to reduce/optimize large images.
-I need a PHP script to be able to resize (proportionately) any uploaded image whose height is more than 300 or whose width is more than 400.
-At that point, if the image size (bytes) is larger than 30k, then the image quality should be reduced (80 quality?).
-Uploaded images will be saved to /img directory. Files names can just be the unix timestamp (number of seconds since 1970?). For example: [login to view URL]
-In addition, I want it to simultaneously save a thumbnail pic of approximately 20pixels. The name for that file can be the same plus '-a'. For example: [login to view URL]
-I would like the large image to have some text placed on it in the lower left corner that says "Image hosted by [login to view URL]". Ability to change text background color would be nice, but not required.
Please use GD Library -- script only needs to work with .jpg images, and should reject anything else. Please address any security issues (bad uploads).
Script should be commented so I can understand what it's doing - in case I need to make changes.
Looking for simple, EFFICIENT code.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
PHP + GD