php SVG convert suddenly not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
neo0814
Posts: 1
Joined: 2014-02-07T05:12:33-07:00
Authentication code: 6789

php SVG convert suddenly not working

Post 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 http://www.imagemagick.org
    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);
$im->setImageFormat("jpeg");
$im->setImageUnits(1);
$im->setImageResolution(300,300);
$im->setImageCompression(imagick::COMPRESSION_JPEG);
$im->setImageCompressionQuality(100); 
$im->writeImage('dealer_case/'.$src);
$im->clear();
$im->destroy();
svg file:

Code: Select all

<svg style="overflow: hidden; position: relative;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/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>
</svg>
.htaccess

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
Post Reply