1

I have Call to undefined function imagecreatefromjpg() error. Although i added gd library as extension=php_gd2.dll in php.ini problem still occurs. What do i need to do?

OS: Windows 10

Edit: Not using XAMPP

Edit2:

vardump(gd_info()) was showing that everything was correct( also phpinfo() says GD Support: enabled GD Version: bundled (2.1.0 compatible)). I used imagecreatefromjpeg() instead and saved as imagepng($im, '/imagename.jpg'); which led me to have jpg still (code is adding png watermark to an image). But still no idea why imagecreatefromjpg() didnt work

gd_info():

array(14) {
 ["GD Version"]=>
 string(26) "bundled (2.1.0 compatible)"
 ["FreeType Support"]=>
 bool(true)
 ["FreeType Linkage"]=>
 string(13) "with freetype"
 ["GIF Read Support"]=>
 bool(true)
 ["GIF Create Support"]=>
 bool(true)
 ["JPEG Support"]=>
 bool(true)
 ["PNG Support"]=>
 bool(true)
 ["WBMP Support"]=>
 bool(true)
 ["XPM Support"]=>
 bool(true)
 ["XBM Support"]=>
 bool(true)
 ["WebP Support"]=>
 bool(true)
 ["BMP Support"]=>
 bool(true)
 ["TGA Read Support"]=>
 bool(true)
 ["JIS-mapped Japanese Font Support"]=>
 bool(false)
}
Emre Karakuz
  • 91
  • 1
  • 5
  • Execute `php -m` in command line to ensure if the extension has been installed correctly – Rinze Jul 20 '21 at 07:20
  • A silly question, but still noteworthy: have you restarted the server after you made the changes? – Definitely not Rafal Jul 20 '21 at 07:24
  • 1
    Which php.ini did you edit? What does `phpinfo()` show? Have you been through all the suggestions in all the duplicates here? Eg https://stackoverflow.com/questions/13338339/imagecreatefromjpeg-and-similar-functions-are-not-working-in-php. – Don't Panic Jul 20 '21 at 07:49
  • edited the question. yes i've checked that @Don'tPanic – Emre Karakuz Jul 20 '21 at 14:54

0 Answers0