<p>Craft requires <a href="https://secure.php.net/manual/en/book.imagick.php" rel="nofollow">Imagick</a> to do any SVG transforms, so that fact that it is working on your MAMP install without it is the only weird thing I see here. :)</p>

<p>Craft will attempt to use Imagick if it is available on the server and fallback to GD otherwise or you can explicitly tell it which one to use via the <a href="http://buildwithcraft.com/docs/config-settings#imageDriver" rel="nofollow">imageDriver</a> config setting.</p>

<p>As to why it's all black on production, make sure you're using a recent version of both the Imagick <a href="https://secure.php.net/manual/en/book.imagick.php" rel="nofollow">PHP extension</a> as well as the underlying <a href="http://www.imagemagick.org/script/index.php" rel="nofollow">Imagick</a> library.</p>

CC BY-SA 3.0
2015-07-27T11:10:24.677Z
Thanks Brad. I've added the `'imageDriver' => 'gd'` setting to the config file and now get the default SVG file icon in the assets area, which isn't perfect but better than a black square :)

I've asked my host to upgrade ImageMagick, as the current version on the server I use is from 2012.
Katrin
CC BY-SA 3.0
2015-07-24T17:50:52.523Z
2015-07-24T17:50:52.523Z
Brad Bell
<p>On my MAMP development server, SVG files display like this in the Assets section of the Control Panel:</p>

<p><a href="https://i.sstatic.net/xd2Rt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xd2Rt.png" alt="enter image description here"></a></p>

<p>On my live server, they get a black background:
<a href="https://i.sstatic.net/ayjO0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ayjO0.png" alt="enter image description here"></a></p>

<p>When I use an SVG file inside an <code>img</code> tag with an transform like this:</p>

<pre><code>&lt;img src="{{ iconSVG.getUrl(iconSize) }}"&gt;
</code></pre>

<p>I got this working fine on the MAMP server, but on the live server the file gets transformed into a PNG with a black background.</p>

<p>I don't necessarily have to use a transform on the SVGs, so could leave that out, but the black thumbs in the Assets isn't that pretty.</p>

<p>I checked both servers, and a possibly relevant difference I can see is that the MAMP does not have <strong>imagick</strong>, whereas the live server does.</p>

<p>How can I fix the black thumbnail issue? Would I need to disable <strong>imagick</strong> on the live server somehow?</p>

CC BY-SA 3.0
2015-07-24T10:01:11.530Z
I think [Craft will prefer GD](https://buildwithcraft.com/docs/requirements) if it is installed, and only fall back on imagick, so I'd start checking if the live env has GD installed. I can also vaguely remember a similar issue with imagemagick and CMYK colors, but I can't remember any specifics.
megatrond
CC BY-SA 3.0
2015-07-24T17:51:24.347Z
@megatrond Close!  Craft will prefer Imagick and fall back to GD if it's not available.
Brad Bell
CC BY-SA 3.0
2015-07-24T18:03:51.483Z
Oh, I had it backwards then! I still can remember something about CMYK and black results from imagemagick though.
megatrond
<assets>
SVG thumbnails black on live server
# SVG thumbnails black on live server

(Asked by: username_0 on 2015-07-24)

On my MAMP development server, SVG files display like this in the Assets section of the Control Panel:

On my live server, they get a black background:

When I use an SVG file inside an img tag with an transform like this:


I got this working fine on the MAMP server, but on the live server the file gets transformed into a PNG with a black background.
I don't necessarily have to use a transform on the SVGs, so could leave that out, but the black thumbs in the Assets isn't that pretty.
I checked both servers, and a possibly relevant difference I can see is that the MAMP does not have imagick, whereas the live server does.
How can I fix the black thumbnail issue? Would I need to disable imagick on the live server somehow?

**Tags:** assets

> **Comments:**
> **username_1**: I think [Craft will prefer GD](https://buildwithcraft.com/docs/requirements) if it is installed, and only fall back on imagick, so I'd start checking if the live env has GD installed. I can also vaguely remember a similar issue with imagemagick and CMYK colors, but I can't remember any specifics.  
> **username_2**: @username_1 Close!  Craft will prefer Imagick and fall back to GD if it's not available.  
> **username_1**: Oh, I had it backwards then! I still can remember something about CMYK and black results from imagemagick though.  

---

## 1 answers

### Answer by username_2 on 2015-07-24. Score: 1

Craft requires [Imagick](https://secure.php.net/manual/en/book.imagick.php) to do any SVG transforms, so that fact that it is working on your MAMP install without it is the only weird thing I see here. :)

Craft will attempt to use Imagick if it is available on the server and fallback to GD otherwise or you can explicitly tell it which one to use via the [imageDriver](http://buildwithcraft.com/docs/config-settings#imageDriver) config setting.

As to why it's all black on production, make sure you're using a recent version of both the Imagick [PHP extension](https://secure.php.net/manual/en/book.imagick.php) as well as the underlying [Imagick](http://www.imagemagick.org/script/index.php) library.

> **Comments:**
> **username_0**: Thanks Brad. I've added the `'imageDriver' => 'gd'` setting to the config file and now get the default SVG file icon in the assets area, which isn't perfect but better than a black square :)  I've asked my host to upgrade ImageMagick, as the current version on the server I use is from 2012.  

---

