"Unable to read image" error while uploading svg image in laravel 4

Viewed 2543

I have code which working ok for jpg,png images to resize images, here is the code sample.

$image = Image::make("{$filePath}/{$fileName[0]}");
// Get the maximum uploaded image width
$maxWidth = Config::get('constants.max_uploaded_image_width');

// Resize the image
$image->resize($maxWidth, null, function($constraint)
{
    // Set an aspect ratio constraint
    $constraint->aspectRatio();

    // Prevent upsizing
    $constraint->upsize();
});

// Save the image
$image->save("{$filePath}/{$fileName[0]}");

This one is working great with jpg and png images, but when i am using svg it will return error like Unable to read image from file. Any solution?

3 Answers
Related