Teshan N.
Teshan N.

Reputation: 2535

Symfony 3 - Using imagecreatefromjpeg in controller gives an error

I am using Symfony 3 and when I try to use imagecreatefromjpeg function in PHP it gives the following error.

Attempted to call function "imagecreatefromjpeg" from namespace "AppBundle\Controller"

How can I fix this?

Upvotes: 0

Views: 679

Answers (2)

Muamar Ali
Muamar Ali

Reputation: 155

Do you already have enable/installed gd extension? If not, you have to install it. You can add it in composer.json( "ext-gd": "*" )

Upvotes: 3

Manzolo
Manzolo

Reputation: 1959

Try using \imagecreatefromjpeg (from global namespace)

Upvotes: 1

Related Questions