문제

In a laravel based application we generate several chart with Jpgraph. Those charts are returned with all the correct headers. Like this:

$response = Response::make($img);
    $response->header('Content-Type', 'image/png');
    $response->header('Content-Disposition', 'inline');
    return $response;

Whereby $img is the result of the Stroke function from jpgraph. Since stroke returns an image stream to the browser, I capture this with ob_get_contents to be able to use it in Response::make

Anyway. This renders the charts perfectly in any and all situation, excep with Dompdf.

The error I get is Image type unknown.

I have added a .png extension to the url but it doesn't work. So far I've found nothing that's even close to a solution.

도움이 되었습니까?

해결책

The problem proved to be something completely different

There was an issue where the Dompdf call to the image did not have the same session and therefore was not allowed to access the image

Thanks to everyone who commented

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top