Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.84k stars 1.5k forks source link

How to encode data URI scheme? #1325

Closed idem84 closed 5 months ago

idem84 commented 5 months ago

Describe the feature you'd like Not found how return output like "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAJYCAMAAAB7MkC6AAADAF..."

If i can load image from that string with Image::read() why not do some thing to output with same format? Some thing like $image->toBase64();

Now i do like that in code: "data:{$image->origin()->mediaType()};base64," . base64_encode($image->encode()) by self

olivervogel commented 5 months ago

See https://image.intervention.io/v3/basics/image-output#creating-data-uri-scheme