Question

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.

Was it helpful?

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top