Forum

Thread tagged as: Error

Broken SVG thumbnail in Assets

Hi,

When I upload an SVG into the Assets app, the thumbnail is broken in two ways:

  1. Instead of being a real thumbnail, it is simply a black 150x150 square
  2. It is displayed at 150x300 (in Chrome 36/Mac), so it overlaps other parts of the UI

The generated img looks like:

<img src="/files/illustrations/structure-en-w150h150@2x.png" alt="Structure (en/SVG)" class="thumb">

In Chrome Dev Tools, when I hover over the image, it reports that it is "150 x 300 pixels (Natural: 275 x 300 pixels)". I don’t see anywhere in the CSS that’s explicitly setting width/height on the image.

My diagnostics:

Perch: 2.5.4, PHP: 5.5.14, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.5.4), assets (2.5.4), perch_blog (4.1)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /srv/www/vhosts/…/perch
PERCH_CORE: /srv/www/vhosts/…/perch/core
PERCH_RESFILEPATH: /srv/www/vhosts/…/perch/../files
Image manipulation: GD Imagick
PHP limits: Max upload 200M, Max POST 800M, Memory: 256M, Total max file upload: 200M
Resource folder writeable: Yes
HTTP_HOST: …
DOCUMENT_ROOT: /srv/www/vhosts/…
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Thanks!

David Newton

David Newton 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can I take a look at the SVG?

Sure. https://www.dropbox.com/s/ouf5roca9iw28ea/structure-en.svg.zip

It was created awhile ago, so I don't remember the details, but I imagine it was run through scour or svgmin or some other SVG optimizer.

Thanks.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's working well here, so that narrows it down to something system-specific.

Are other SVGs working ok?

I haven't tried any other SVGs yet, but I'll keep an eye on it. Thanks!