Resize image and display
Posted by: Jaysdad (---.range165-120.btcentralplus.com)
Date: November 22, 2016 10:43PM

I have the following to display an image full size, and it works well.
echo '<img src="'.$path.$match["photoname"].'" />';

I also have a function that resizes an image, that come up with no errors.
The function is:
function resize_image($file, $w, $h, $crop=FALSE) {

and it returns data as follows
$src = imagecreatefromjpeg($file);
$dst = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

return $dst;


I cant seem to get the syntax correct to join the two together.

I have the following and I get nothing showing.
echo '<img src="resize_image('.$path.$match["photoname"].',200,200" />';
or
echo '<img src="$img=resize_image('.$path.$match["photoname"].',200,200" />';



Any pointers greatly appreciated.

Options: ReplyQuote
Re: Resize image and display
Posted by: Otomatic (Moderator)
Date: November 23, 2016 09:22AM

Hi,

This question is not Off Topic
This site is for people having issues getting WAMPServer running and not a general HOW DO I site for everything web related.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 11/23/2016 10:49AM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.