|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59022 Imagick::setResolution() does not work for SVG-files anymore
Submitted: 2010-01-06 15:49 UTC Modified: 2010-02-28 07:41 UTC
Avg. Score:4.6 ± 0.7
Reproduced:14 of 14 (100.0%)
Same Version:7 (50.0%)
Same OS:3 (21.4%)
From: sualk at lednew dot de Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 2.3.0 (also 3.0.0b1, 2.2.1 and under some conditions 2.2.2) OS: Linux Ubuntu 9.10; php 5.3.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
14 + 21 = ?
Subscribe to this entry?

 [2010-01-06 15:49 UTC] sualk at lednew dot de
*Aim*: Resizing of vector graphics, pdf, ps, eps etc. WITHOUT Interpolation.

*by way of comparison the procedure in shell*: convert start.svg --density 123x123 end.png

*Procedure in php*: 
1. Create new Imagick-Object
2. set new Resolution
3. read Image

It works very fine for pdf, ps, eps etc. It DID work very fine for SVG-files too, while I used PHP 5.2.xx; ImageMagick 6.5.1 and Imagick-2.2.2

It did/does NOT work for SVG with:
PHP 5.2.xx; ImageMagick 6.5.1 and Imagick-2.2.1
PHP 5.3.1; ImageMagick 6.5.1 and Imagick-2.3.0
PHP 5.3.1; ImageMagick 6.5.1 and Imagick-2.2.2
PHP 5.3.1; ImageMagick 6.5.8 and Imagick-2.3.0
PHP 5.3.1; ImageMagick 6.5.8 and Imagick-3.0.0b1

Reproduce code:
$im = new Imagick();

var_dump($im->getImageResolution()); // Shows old value, should be 123

// Also try with a pdf- or ps-file and it works perfectly!

Expected result:
array(2) { ["x"]=>  float(72) ["y"]=>  float(72) }
array(2) { ["x"]=>  float(123) ["y"]=>  float(123) } 

Actual result:
array(2) { ["x"]=>  float(72) ["y"]=>  float(72) }
array(2) { ["x"]=>  float(72) ["y"]=>  float(72) } 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-07 03:57 UTC] sualk at lednew dot de
Chosen wrong package yesterday
 [2010-01-27 14:54 UTC]
I wonder whther this depends on which svg library the underlying ImageMagick uses. Testing locally here:

# php test.php
array(2) {
array(2) {
 [2010-02-28 07:41 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

 [2010-04-06 18:18 UTC] matt at raines dot me dot uk
I have this same problem on
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7

Imagick::getVersion() reports:
array(2) {
  string(68) "ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP"

This is the current (stable) Ubuntu package "php5-imagick": 2.1.1RC1-1build2

How do I find out which SVG library ImageMagick uses?
 [2011-01-03 20:43 UTC] pembeci at gmail dot com
I have the same problem. Given code produces the wrong result. Please reopen the issue. It seems like I am not allowed to do it.

PHP : 5.2.11
imagick : 2.2.1-dev 
ImageMagick : 6.6.1

I couldn't find a specific library file related to svg in my ImageMagick distribution.
 [2012-01-05 05:52 UTC] jake dot lauer at gmail dot com
I am also having this problem still. PHP 5.2.17, ImageMagick 6.7.2-10, Imagick 3.0.1
 [2012-09-26 08:11 UTC] bernie dot spam at gmx dot at
Same problem here.

Imagick 3.1.0RC2 
ImageMagick 6.7.9-7 2012-09-25 Q16

On commandline it works fine: 
convert -density 500 source.svg target.png 

Same with imagick produces a low quality png, an set resulution is ignored: 

$im = new Imagick();
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 17:01:24 2021 UTC