Image resize PHP -


I am trying to make a simple image resize feature, can you tell me where I am wrong :

// Resize image image $ imageSrc = imagecreatefromjpeg ('http://www.katsmurals.com/cms/'. Target_path); $ Width = imagesx ($ imageSrc); $ Height = images ($ imageSrc); Echo per quarter; $ Height echo; // new dimension $ i = $ width; $ J = $ height; While ($ i> 700) {$ i = $ i / 1.5; $ J = $ j / 1.5; } $ Image_p = imagecreatetruecolor ($ i, $ j); $ Image = imagecreatefromjpeg ('http://www.katsmurals.com/cms/'.$target_path); Imagecopyresampled ($ image_p, $ image, 0, 0, 0, 0, $ i, $ j, $ width, $ height); $ NewImage = $ target_path.'_ scaled.jpg '; Imagejpeg ($ image_p, $ newImage, 80); $ Target_path is the newly uploaded image, if I have more than 700 width then I want to resize it.

This is done once, a DB is updated with information, the image is being uploaded properly, but the size is exactly the same, the resizing code is not working ?


Comments