Maximum size convertion svg to png

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?".
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Maximum size convertion svg to png

Post by corematrixx »

Dear!
I have a query about of which is the maximum size that can convert a svg to png.

because I have a function in php that converts svg to png but if you enlarge the web shows "internal error"

I leave the link for you to check: 
svg average size
http://vps-1150061-19745.manage.myhosti ... /svg/b.svg

convert function
http://vps-1150061-19745.manage.myhosti ... png2/b.svg

result
http://vps-1150061-19745.manage.myhosti ... igns/b.png

****
svg large
http://vps-1150061-19745.manage.myhosti ... /svg/a.svg

convert function
http://vps-1150061-19745.manage.myhosti ... png2/a.svg

result
http://vps-1150061-19745.manage.myhosti ... igns/a.png

I need your help to take several days looking for the error and why. be the liberia? or vps?

Greetings from Chile!
pd: thanks to google translate :P
Last edited by corematrixx on 2014-06-21T19:24:29-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Maximum size convertion svg to png

Post by snibgo »

The SVG links are broken.
snibgo's IM pages: im.snibgo.com
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

snibgo, link are now repaired, thank you for commenting.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Maximum size convertion svg to png

Post by snibgo »

The links:
http://vps-1150061-19745.manage.myhosti ... png2/b.svg
and
http://vps-1150061-19745.manage.myhosti ... png2/a.svg
are still broken.

Converting the other two SVGs, I get the same results as you. What is wrong with them?
snibgo's IM pages: im.snibgo.com
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

sure the error is given in the second link, which is why I need help I can not convert this file to png png, I think there is a limitation to the size.

http://vps-1150061-19745.manage.myhosti ... /svg/a.svg

link that says these are broken contain this function.

Code: Select all

    public function convert_png2($file_svg){
        error_reporting(E_ALL);
         ini_set('display_errors', 1);
        // $file_svg='80.svg';
        $file_name=explode('.',$file_svg);
        $svg1 = BASE_URL2.'images/designs/svg/'.$file_svg;
        $im = new Imagick();
        $im->setBackgroundColor(new ImagickPixel('transparent'));
        $svg = file_get_contents($svg1);
        
        $im->readImageBlob($svg);
        
        /*png settings*/
        $im->setImageFormat("png24");       
        $url='../images/designs/'.$file_name[0].'.png';
        $im->writeImage($url);
        $im->clear();
        $im->destroy();

        return BASE_URL2.'images/designs/'.$file_name[0].'.png';

    }
well I would like to know if anyone can turn this svg to png, try it by command line and says "killed".
http://vps-1150061-19745.manage.myhosti ... /svg/a.svg

Greetings!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Maximum size convertion svg to png

Post by fmw42 »

It works fine for me and only takes a few seconds on IM 6.8.9.3 Q16 Mac OSX with RSVG 2.40.2 as my SVG delegate and libpng 1.6.10
See http://www.libpng.org/ for details about the PNG format.


convert -list format

PNG* PNG rw- Portable Network Graphics (libpng 1.6.10)

SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.2)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (RSVG 2.40.2)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Maximum size convertion svg to png

Post by snibgo »

I can convert it with no problem. It is large: 7600x8460 pixels. Perhaps your server has set a limit.
snibgo's IM pages: im.snibgo.com
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

fmw42 than good! apparently is the operating system for the error resulting in the console that says "killed" as an error message. I saw a post this
viewtopic.php?f=3&t=19643 , and so I understood a short service process CONVERTION, now I have to see how to configure Cent OS.

if anyone knows how I would appreciate, as I do not drive much in linux.
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

Snibgo, know how to set this limit?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Maximum size convertion svg to png

Post by fmw42 »

Did you try the suggestion on that link

Code: Select all

convert -limit area 0 a.svg a.png
see http://www.imagemagick.org/script/comma ... .php#limit
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

fmw42 worked perfectly! thank you very much! Now I'll see how to do it from php, I'm just starting to use imagick, and is seen to be a very powerful library.

Greetings from Chile, and thank you very much.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Maximum size convertion svg to png

Post by fmw42 »

Imagick does not have all the features of Imagemagick. I would suggest you use PHP exec() to run Imagemagick commands directly. I do not think that Imagick has an equivalent to -limit. But I do not use Imagick much and am not an expert with it.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Maximum size convertion svg to png

Post by fmw42 »

You may be able to speed up your processing by increasing the -limit area size. You should increase it in increments and find out how large it can be before it give you that error message again.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Maximum size convertion svg to png

Post by fmw42 »

This post does not appear to be suited to the Consulting forum, since that is for paid consulting. So I have moved this post to the Users forum.
corematrixx
Posts: 7
Joined: 2014-06-21T02:24:23-07:00
Authentication code: 6789

Re: Maximum size convertion svg to png

Post by corematrixx »

I knew it was not right payment inquiries here. whether it should be moved to users.
I managed to do anything from php with the following line of code.

Code: Select all

IMagick::setResourceLimit(IMagick::RESOURCETYPE_AREA, 0);
http://php.net/manual/en/imagick.setresourcelimit.php
Post Reply