~n[EO]n~ Posted October 14, 2007 Share Posted October 14, 2007 Is there any other way to upload image through PHP without GD support. My hosting server does not support GD, ??? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/ Share on other sites More sharing options...
Orio Posted October 14, 2007 Share Posted October 14, 2007 You dont need the GD library to upload an image... http://www.php.net/features.file-upload Orio. Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369166 Share on other sites More sharing options...
~n[EO]n~ Posted October 14, 2007 Author Share Posted October 14, 2007 yeah thanks i saw that I am getting this error on server Fatal error: Call to undefined function: imagecreatetruecolor() in /home/shankhad/public_html/includes/app.class.php on line 420 line 420 got this $image_p = imagecreatetruecolor($new_width, $new_height); it works fine in localhost but when i upload my files it does not work online , when i viewed phpinfo() online there is no GD (not even a single word), So, the question is can I make this current code work with minor modification or I have to re-code ? any ideas... Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369174 Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 You need GD to use imagecreatetruecolor(), you do not however need that function to upload an image. Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369176 Share on other sites More sharing options...
~n[EO]n~ Posted October 14, 2007 Author Share Posted October 14, 2007 So, can i resize my image without using GD Library ??? I uploaded with this code but I couldn't resize the image <?php if($frfilenamegif!="" && $imageErrorFlag==false) { if(!ereg(".gif", $_FILES["txtimagegif"]["name"])) { $msg="File should be of .gif type."; $imageErrorFlag1=true; } else { $filePathgif = $uploadDir.$frfilenamegif; $strfilepath=move_uploaded_file($tmpNamegif,"../".$filePathgif); $strfile=$filePathgif; }?> Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369179 Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 So, can i resize my image without using GD Library Nope. Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369182 Share on other sites More sharing options...
~n[EO]n~ Posted October 14, 2007 Author Share Posted October 14, 2007 Oops I am dead :o , other then switching the hosting the last option is defining the image height and width manually in <img src=<?=rs['image'];?>height='300' width='300'> right, but doing like this will distort the image, am i right ??? Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369186 Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 Yeah, without GD your pretty much stuck. You could try and find out if you have imagemagik installed. Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369188 Share on other sites More sharing options...
~n[EO]n~ Posted October 14, 2007 Author Share Posted October 14, 2007 no imagemagik too... anyway thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/73184-solved-php-image-uploading/#findComment-369191 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.