Alex
Alex

Reputation: 31

convert image blob: to php gd

Good night I have a problem with this

imagecreatefromstring('blob:https://myweb.com/1475db94-d450-44c7-a02f-c06e9fe46a6a');

error output

Message: 'imagecreatefromstring(): Data is not in a recognized format

Upvotes: 0

Views: 698

Answers (1)

Phil
Phil

Reputation: 165065

  1. blob isn't any kind of protocol PHP handles (see http://php.net/manual/wrappers.php).

  2. imagecreatefromstring() expects a string of binary data, not any kind of URI.

I think you need

$uri = 'https://myweb.com/1475db94-d450-44c7-a02f-c06e9fe46a6a';
$image = imagecreatefromstring(file_get_contents($uri));

Upvotes: 1

Related Questions