dicroce
dicroce

Reputation: 46780

Can you create a GD image in PHP from an image in memory?

I need the a function like imagecreatefrompng(), but I want to pass in the image directly (as opposed to the filename). Is this possible?

Note: I need this because the image is coming from a blob in a database.

Upvotes: 2

Views: 738

Answers (2)

CrayonViolent
CrayonViolent

Reputation: 32532

Yes, you can use imagecreatefromstring()

ttp://us2.php.net/manual/en/function.imagecreatefromstring.php

Upvotes: 2

alex
alex

Reputation: 490243

imagecreatefromstring()

It should detect it is a png from the image header and return an image resource.

Upvotes: 4

Related Questions