I need to allow uploads of photos to a site. This works OK, I have limited the file size to 40K, limited to jpeg format and was amazed that this all worked first time. However the bad man at the top isn't happy, oh no!
He also wants me to check the size of the image to ensure it is no more than 300pixels wide by 300pixels high and if it is to resize it within these dimensions.
I am having trouble with this so my pride at getting photo uploads to work has now turned to misery. If anyone can help It would be worth a virtual beer or two.
Thanking you in advance
Ianeasy, looked into getimagesize() but you have to have the gd library installedScoutt.
That works great and gives me the dimensions of the image and I have now worked out what I need to resize each image by. This means I'm showing the image OK now in the browser using the HTML image field, but I would like to resize the image that sits on the server as well if at all possible. Any ideas
As always very thankful
Ianjust like before. the gd library has many functions to use.
<!-- m --><a class="postlink" href="http://us4.php.net/manual/en/ref.image.php">http://us4.php.net/manual/en/ref.image.php</a><!-- m -->
out of that link you need to look into
imagecreatefromjpeg
or what the image atually is, ie. gif, png, bmp
He also wants me to check the size of the image to ensure it is no more than 300pixels wide by 300pixels high and if it is to resize it within these dimensions.
I am having trouble with this so my pride at getting photo uploads to work has now turned to misery. If anyone can help It would be worth a virtual beer or two.
Thanking you in advance
Ianeasy, looked into getimagesize() but you have to have the gd library installedScoutt.
That works great and gives me the dimensions of the image and I have now worked out what I need to resize each image by. This means I'm showing the image OK now in the browser using the HTML image field, but I would like to resize the image that sits on the server as well if at all possible. Any ideas
As always very thankful
Ianjust like before. the gd library has many functions to use.
<!-- m --><a class="postlink" href="http://us4.php.net/manual/en/ref.image.php">http://us4.php.net/manual/en/ref.image.php</a><!-- m -->
out of that link you need to look into
imagecreatefromjpeg
or what the image atually is, ie. gif, png, bmp