Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php simple image resize after upload

I looked around for a while and found some very confusing and complicated stuff that I couldn't get to work.

I'm using chronoforms with joomla to make a form with an upload file script, and it uploads the image to the server with no problems, so far so good.

I need to take the uploaded image and resize it, better yet, is there a way to resize the image before uploading it to the server?

Thanks.

like image 466
Mankind1023 Avatar asked Nov 06 '11 20:11

Mankind1023


2 Answers

I use this easy 1 function that does it all

check it out :

http://www.nimrodstech.com/php-image-resize/

https://github.com/Nimrod007/PHP_image_resize

like image 156
Nimrod007 Avatar answered Oct 09 '22 07:10

Nimrod007


I have used PHPThumb for a few of my projects and found it easy to work with and has a small resource footprint. You can read the docs for more info, but is pretty easy:

$thumb = PhpThumbFactory::create('/path/to/source/image.png');

$thumb->resize(100, 100);

$thumb->save('/path/where/you/want/resized/image.png');
like image 28
Mike Purcell Avatar answered Oct 09 '22 07:10

Mike Purcell