1

tried to find some reason for this strange issue for some time now, I hope somebody can help me.

I have a Laravel 5 app. There is one controller method that should return an image from the storage (S3 or local) and add some filling for png backgrounds. It was totally working since yesterday, but now it stopped to work without any possible reason.

This is my code:

<?php

class Controller{

    public function gimmeTheImage(){
        $img = \Image::make('img/profile/placeholder.jpg'); // Also tried with binary data from S3 via \Storage::get($pathtofile);
        $img->doSomething(); // like filling the background or resizing...

        return $img->response('jpg'); // This worked until yesterday
    }
}

Until yesterday, this gave me a perfect jpg result, now it just produces a broken image. The error is independent of browsers (tested Chrome, Safari, Firefox), there were no composer updates that could have changed anything (besides I rolled back everything) and there is no error message in the logs. The produced files do contain the correct mime type and have some seamingly correct filesize but just don't work. I also tested this on several servers, so it should not be a gd error.

Any idea?

mvmoay
  • 1,535
  • 3
  • 15
  • 26
  • 1
    What do you mean with "the images just don't work"? There is no way something just stops working without you changing anything. Can you open the image on your desktop? Is the image corrupt? Have you tried saving the image with Intervention and checking what happens? Have you tried leaving the `response()` paremeters empty? – Nick May 22 '15 at 11:36
  • Sorry, didn't have the time to go the proper way, so I ended up with some workaround which was not using the S3/Intervention combination anymore. – mvmoay Jun 03 '15 at 12:50
  • @Nick Hi, this might be necroing a bit but for future users: what he means by image does not work is ; they simply stops being image files. the encoding is so horribly corrupted that photos/paint no longer recognizes the file as a valid bitmap file. I am encountering the same issue. Stuck with legacy code I guess :( – Mash tan Jun 26 '22 at 07:22

0 Answers0