laravel - PHP create image file using imagecreatefromstring, without knowing the format of the image -


i'm developing laravel restful app accepts image strings users , must store them.
images encoded , sent app. know have receive , decode image this:

$imagedata = base64_decode($imagedata); $source = imagecreatefromstring($imagedata); 

but dont know how save them files, without knowing format of image?is there way find out image extension, can use functions like:
imagepng


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -