ajoo Posted November 11, 2016 Share Posted November 11, 2016 (edited) Hi all, Below is the last bit of code that loads an image from a local machine, resizes it and displays the resized image on a screen. imagepng($dst); // displays the resized image imagedestroy($src); imagedestroy($dst); What I want to do now is to save the resized image on the server. How may I do that ? Any help is much appreciated. Thanks all. Edited November 11, 2016 by ajoo Quote Link to comment https://forums.phpfreaks.com/topic/302515-storing-a-resized-image-on-the-server/ Share on other sites More sharing options...
Solution Barand Posted November 11, 2016 Solution Share Posted November 11, 2016 imagepng imagepng($dst, 'path/to/file'); Quote Link to comment https://forums.phpfreaks.com/topic/302515-storing-a-resized-image-on-the-server/#findComment-1539218 Share on other sites More sharing options...
ajoo Posted November 12, 2016 Author Share Posted November 12, 2016 Hi Guru Barand ! I tried that before I asked but i was getting an error. It said something like - the $filename ('path/to/file') should be a resource and not a string. - but eventually it worked. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/302515-storing-a-resized-image-on-the-server/#findComment-1539230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.