-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel : Unable to init from given binary data. #634
Comments
same issue with CakePHP, only for some images... |
Hey, I have exactly the same issue. Most images work just fine, but there are a few which cause this exception. Converting the file from .png to .jpg solves the issue for a particular image, but that doesn't seem like the final solution. I'm running Laravel 5.3 on PHP 5.6 and GD installed. Any help would be greatly appreciated :) |
same issue here, only with some photos |
some issue here in Laravel 5.3 and Valet. |
Same issue here with Laravel 5.3 and Homestead (Ubuntu 16.04, PHP 7.0.8) |
+1 |
Same problem with Laravel 5.1 and images mounted via s3fs. It worked perfectly when not having these images mounted, so I first thought permissions or problems with s3fs were causing this. |
Maybe the image is invalid. Can you provide the base64 data of a not working image? |
Any update on this issue? I face the same problem with some images and it depends on the server (same image on a different server gives me different result..) |
Also getting the same error. Problems with a bmp file. |
some issue, all jpg wont work, only png |
same here when trying to convert images from a opensim grid to a viewable format like png and i have tried all i could find using google. |
+1 |
Same problem |
Same |
Hi guys, I was facing the same problem here. Basically, I was trying to read a base 64 encoded image like this:
So I was getting this:
After several tries, I decided to write the image to a file and then read the file using the make function. Something like this:
This approach hasn't worked either. However, the error message changed to:
So, I realized that could be all about my GD installation. My phpinfo() indicated GD was correctly installed, but there wasn't any clear message informing about the JPEG support. I decided to compile my GD again, using the --with-jpeg option, and then, compile PHP again, using --with-gd=/usr/local/include. For my surprise, after rebooting Apache, Image::make started working properly. My next step was retry the "direct from base 64" approach. And finally, it was working fine too!! I'm using PHP Version 7.1.6, lib GD version 2.1.1 and. Laravel version 5.4.28. Hope this helps! |
make sure of base64 image string you are sending is a valid image |
i have the same error but not in laravel make sur your option upload_max_filesize in php.ini respect taille of your image upload |
use this to handle coming img source: and in your /Intervention/Image/AbtractDecoder.php:
im using laravel 5.5 and php 7.1, this working good, good luck !! |
Hitting this issue too with PHP 7.2.3 and GD bundled (2.1.0 compatible) |
Try to add this line to php.ini config
Download cacert at here: https://curl.haxx.se/docs/caextract.html |
I have the same error. Intervention code (get base64 string from ajax request): response error: Updating GD library: Here is the base64 data of a not working image: |
My solution for issue that I have described above:
This helped me, and now I dont have any errors when uploading image |
I have also same issue. Working with all png files. But not with jpg files. here is base64 data. it is proper image and data is true.
|
confirmed on Laravel Framework 5.8.36 with PHP 7.4.1 |
I'm not sure about this issue, at first I develop my project with PHP 7.2 on my local and push it to my heroku. The live server is still working, but when I clone my project, I got this error when using PHP 7.2. After changing to PHP 7.4.2, it works again.
Thank to @handhikadj |
Just use |
In my case, this happened with jpg and jpeg images, png works fine. As a work around, I used this option .
or a more efficient approach will to be get the image extension then pass it as argument to the encode function, this way it always gets the correct stuff |
Dear friends, I've met the same errors whenever I try to change/update the avatar for any user on the new installed flarum forum: Intervention\Image\Exception\NotReadableException: Unable to init from given binary data. in /vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:115\nStack trace:\n#0 /vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php My environment is as follows: Can any friend can help that? |
Getting same (or similar?) error on Laravel 8.32 and PHP 8.0.3 It happens from calling I tried @avimeney workaround (#634 (comment)) but it made no difference in my situation. Any word from package maintainers about this issue? Most images work fine but very rarely one will fail like this. These are user-uploaded images. I'm trying to find out how the above image was saved in case that gives a clue. I know it was saved in Adobe Photoshop and the software provides several options when saving. |
Getting the same problem. Sometimes the mime type isn't correct AbstractDecoder.php returns "image/webp" instead of "image/jpeg" It's impossible to generate a image from the given data, correct! I add this line to my code: $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data); I hope may help you. |
Hi, Image::make($path) <- doesn't work for me |
Hi there,
I'm on vacation until 11/01, unfortunately, I won't be able to answer before, if it's an urgent matter, please contact the responsible parties:
For web, app or game development: ***@***.***
For content, traffic or SEO: ***@***.***
Olá,
Estou em periodo de férias até 01/11, infelizmente não vou conseguir responder antes, se for algum assunto urgente, por favor, contate os respectivos responsáveis:
Para desenvolvimento web, app ou jogos: ***@***.***
Para conteúdo, trafego ou SEO: ***@***.***
|
This worked for me:
|
In which file you changed @Tapha |
My error was: "Unable to init from given binary data." My solution was to change the domain name. In the same hosting in another domain, it was working fine but in another domain, I got that error. Then I changed the application to another domain and this is how I solved my issue. |
I got this error when my upload_max_file_size was too small |
Hi, I'm using laravel 5.3 , with PHP7 and GD installed. I face this problem with some images :
with some photos when I want to create them from base64, Here is my code:
with no lcuk, I tried this one:
but it doesn't work too.
here is a link for one of those images.
The text was updated successfully, but these errors were encountered: