Page 1 of 1

php SVG convert suddenly not working

Posted: 2014-02-07T05:39:32-07:00
by neo0814
The code below worked yesterday. but with same code and same SVG file , it is not working now.
I've called the server supplier and they told me they didn't make any change. ( of course I didn't touch anything either )
Now it will output a blank file with correct width/height but nothing on it.

It is a auto system that covert browser side Raphael JS SVG . it works well about 2 months. I really have no idea why it break.

My PHP version : 5.3.27
imagick info from phpinfo :
  • imagick module version 3.1.2
    imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
    ImageMagick version ImageMagick 6.5.4-7 2012-12-14 Q16
    ImageMagick copyright Copyright (C) 1999-2009 ImageMagick Studio LLC
    ImageMagick release date 2012-12-14
    ImageMagick number of supported formats: 198

Code: Select all

$im = new Imagick();
$svg = file_get_contents($svg_path);
$im->readImageBlob('<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.$svg);
svg file:

Code: Select all

<svg style="overflow: hidden; position: relative;" xmlns="" xmlns:xlink="" width="930" version="1.1" height="1719">
<rect transform="matrix(1,0,0,1,0,0)" x="0" y="0" width="930" height="1719" r="0" rx="0" ry="0" fill="#000000" stroke="none"></rect>
<image transform="matrix(1,0,0,1,108,-102)" preserveAspectRatio="none" x="-300" y="90" width="1350" height="1800" xlink:href="temp/52f193a528d33.jpg" opacity="1"></image>

Code: Select all

php_value max_input_time 120
php_value max_execution_time 120
php_value post_max_size 128M
php_value upload_max_filesize 32M
php_value memory_limit 128M
php_value session.gc_maxlifetime 18000
php_value max_input_vars 3000