-
-
Notifications
You must be signed in to change notification settings - Fork 111
images not showing on laravel 5.4 #80
Comments
Hi, I have the same issue on Laravel 5.1.31 and PHP 5.5.38. Bart, have you fixed it? Thanks. |
try this for instance (different for your example but.....) spent last 2 hours trying to find a fix and this did it! ob_end_clean();
return($cachedImage->response('jpg'));
```php
from:
http://simpledeveloper.com/how-to-fix-laravel-response-image-download-in-laravel/
https://laravel.io/forum/02-16-2016-laravel-51-intervention-corrupted-image |
maybe @olivervogel can look at this, because it seems to be a package problem and not a usage problem? |
thnx @codemonkeynorth seems to work when i add ob_end_clean(); at 2 places, so @zaplachinsky and people at issue #60 try to change the ImageCacheController.php to this: (of cource this is not THE solution, would be nice if @olivervogel will still look into the real problem)
|
What is the actual output on the requested image route? (Broken image or square on a black screen could be anything.) |
@olivervogel thanks for the quick folowup ;)
|
No, I mean what do you get if you request only the image?
|
here i can also see the one string is working, the other not: http://freeonlinetools24.com/base64-image |
@olivervogel when you're saved the base64 codes, please tell me, i'll delete it then, just to prevent others from tracking things we do ;) |
Why do you get base64 encoded data from the route? If you setup URL based image manipulation you should just get regular image data. PS: You can delete. |
deleted |
no, i just get the image, but if i click the source in chrome, i get the base64, what other response would you like me to post? ;) |
@olivervogel if you would like to, you can look with me at teamviewer? cant realy post all real routes and everything becouse of bussiness use ;) |
@olivervogel, I always get this square image when I request something like this:
|
@zaplachinsky that's the same problem here ;) |
I think you setup imagecache like it is described in the docs. I would just like to know what image data you get from the route, when you got a corrupt image (square on black screen). Just do a quick curl and take a look what you get:
|
when its in the working and not working modus, i both get a screen with code but after a milisecond it clears and gives me:
|
so nothing to see here |
so chrome is just showing the right image when ob end clean in added, and the little square when not added. only when going into the chrome inspector and clicking on the sources tab, and clicking the image, is giving the base64 data, the working one and the not working one. any other inspector tab you want me to look at and copy paste to you? or wanna look with me? |
@olivervogel and yes "I think you setup imagecache like it is described in the docs." yes i did it just folowing the docs ;) |
@codemonkeynorth yes, the base64 version that @olivervogel has now, was also different |
my working and not working give different base64, but the same response as you, but instead of spaces in the beginning, i get a blank line at the wrong file, and no blank line at the right file.
|
@codemonkeynorth what cache meganism is your default? here it's redis.
.env:
.env overrides the config but, also when changing to CACHE_DRIVER=file, php restart, clear cache, it has the same behaviour. what cache do you use @olivervogel ? |
I'm using file cache. |
The whitespace is the problem. But neither Intervention Image or Intervention Imagecache produces this whitespace. I think this may be a issue with Laravel's or Symfony's Cache/HTTP modules or the combination of them. This might be helpful: |
@olivervogel that's the same we do now, adding the ob_end_clean() before the return... so is that realy the solution? and should be added to your package? where is the output buffer start then? as i read the topic, it is somewhere in laravel itself, but the laravel code dousn't close it? |
hi @olivervogel . that's the link I posted above, which is where i got ob_end_clean() from so I understand that it's a general Laravel buffer issue not a specific Intervention issue , thanks. |
Adding |
@olivervogel i'll ask laravel and point them to this ;) |
@olivervogel @codemonkeynorth as you see, i posted an issue at the laravel framework: laravel/framework#18687 hope @themsaid or @taylorotwell will take a quick look at it ;) |
ob_end_clean(); +1 |
Buddy... you just saved my day Working in Laravel 7.4
|
ob_end_clean(); |
ob_end_clean(); Is the solution :) |
ob_end_clean(); Is the solution 2 :) |
"Found a space before the php tag in my package's config file" |
Hi,
Just installed intervention/image and intervention/imagecache on laravel 5.4
I couldn't get the package working right. Tracked down the way how the image should be displayed all down to the ImageCacheController.
Requesting the original route The current output it returns is:
and it's not showing any picture, only a square on a black screen:
![squareinblack.png](https://camo.githubusercontent.com/1b7a418e6b8e23426585f12e470c244b8318f3ef699544bb943ad1962149dcbc/68747470733a2f2f73392e706f7374696d672e6f72672f646d767938353063662f737175617265696e626c61636b2e706e67)
when i change the getOriginal function to:
and requesting the original route, the output is:
and it's just working
I think something is wrong with the buildResponse function?
requesting other pre defined templates like small, medium and large are giving the same square as result.
Bart
The text was updated successfully, but these errors were encountered: