473,224 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

SVG->PNG image conversion

Hi all,

I don't have ImageMagick installed currently (and not sure if this has the
ability or not anyway yet), but I've done some googling and not come up
with much (if anything) regarding this.

I'm hoping to write a script that I can use to accept user input for x,y
coords for an image size. The image would initially be stored in SVG
format for quality and would like to then resize this according to the
users dimension specifications and produce a PNG image.

My server doesn't run X (for obvious reasons? =) ) and I don't _really_
want top have to bloat it out with gnomelibs and the likes to install
Sodipodi on it to do the conversions so was wondering if anyone knew of
anything available to help in the process.

I'm happy to work on the XML itself with PHP (althoguh I'd need to
research some on the topic).. but was kind of hoping someone knew of a
small binary that I could run via system() / exec() etc for simplicity.

Any info / suggestions / recommendations et al. greatly welcomed =)
TIA.

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #1
6 27666

On 2003-12-20, Ian.H <ia*@WINDOZEdigiserv.net> wrote:
Hi all,

I don't have ImageMagick installed currently (and not sure if this has the
ability or not anyway yet), but I've done some googling and not come up
with much (if anything) regarding this.
[..]
My server doesn't run X (for obvious reasons? =) ) and I don't _really_
want top have to bloat it out with gnomelibs and the likes to install
Sodipodi on it to do the conversions so was wondering if anyone knew of
anything available to help in the process.


You dont need X to run imagemagick's convert program.
Jul 17 '05 #2
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
news:sl********************@babar.tuffmusik.nu...
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use ImageMagick with
PHP? I don't have that access but I do need to convert my SVG files to PNG
(or some other raster format). Java isn't enabled in my PHP configuration
either. What now?

Remon.
Jul 17 '05 #3

On 2003-12-25, Remon Huijts <tr*****@hotmail.com> wrote:
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use
ImageMagick with PHP? I don't have that access but I do need to
convert my SVG files to PNG (or some other raster format). Java
isn't enabled in my PHP configuration either. What now?


Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.
Jul 17 '05 #4
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
news:sl********************@babar.tuffmusik.nu...

On 2003-12-25, Remon Huijts <tr*****@hotmail.com> wrote:
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use
ImageMagick with PHP? I don't have that access but I do need to
convert my SVG files to PNG (or some other raster format). Java
isn't enabled in my PHP configuration either. What now?


Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.


Well I tested ImageMagick on my Windows machine a little, though I will be
needing it on a shared Linux server. My first SVG -> PNG convert did not
look very well, but I understand that there is still some work to do in the
ImageMagick support for SVG. Do you happen to know a list of things that are
not supported yet? For instance, looking at the PNG result, my first guess
is that defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.

Remon.
Jul 17 '05 #5
On 2003-12-26, Remon Huijts <tr*****@hotmail.com> wrote:
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
news:sl********************@babar.tuffmusik.nu...

On 2003-12-25, Remon Huijts <tr*****@hotmail.com> wrote:
> "Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
>> You dont need X to run imagemagick's convert program.
>
> Will I need access to my php configuration before I can use
> ImageMagick with PHP? I don't have that access but I do need to
> convert my SVG files to PNG (or some other raster format). Java
> isn't enabled in my PHP configuration either. What now?
Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.


Well I tested ImageMagick on my Windows machine a little, though I will be
needing it on a shared Linux server. My first SVG -> PNG convert did not
look very well, but I understand that there is still some work to do in the
ImageMagick support for SVG. Do you happen to know a list of things that are
not supported yet?


Nope, sorry. I just did att quick test with a small svg and it
worked.
For instance, looking at the PNG result, my first guess is that
defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.


I suggesst you read up on http://www.imagemagick.org/ and the mailing
lists for. Why not try to add the needed/broken <style>-support to IM
yourself?
Jul 17 '05 #6
"Martin Wickman" <wi*****@hotbrev.com> schreef in bericht
news:sl*******************@babar.tuffmusik.nu...
On 2003-12-25, Remon Huijts <tr*****@hotmail.com> wrote:

For instance, looking at the PNG result, my first guess is that
defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.


I suggesst you read up on http://www.imagemagick.org/ and the mailing
lists for. Why not try to add the needed/broken <style>-support to IM
yourself?


Can I do that without programming in C? Sadly I could not find any specific
information about SVG support on the ImageMagick site. There was little
discussion about it on the forums as well. On top of that I found out that
my hosting provider does not have ImageMagick installed on the server. So I
decided to step away from ImageMagick, and eat up the SVG with PHP, and spit
out some PNG using the PHP GD library. That kills a lot of the nice
anti-aliasing though...

Remon.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tonio | last post by:
Do any browsers support the use of SVG files as background images through CSS? I haven't been able to get it to work in IE6.
7
by: Dennis Benzinger | last post by:
Hi! Does anybody know of a SVG rendering library for Python? Bye, Dennis
61
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the...
1
by: Ganesh Palaniappan | last post by:
Would like to know whether any free tool (ActiveX kind of thing) available for SVG-WMF conversion or PNG-WMF conversion. Thanks in advance.
2
by: neilsanner | last post by:
Hi, Is there a way/library to convert a file in SVG format to PNG? neilsanner
1
by: Zhang Weiwu | last post by:
Hello. On one webpage I just worked out, I use svg (by using <object>) for browser that supports svg (firefox), and give an <imginside of <objectas a fallback for IE. ...
4
by: asedt | last post by:
I have used this: http://www.fileformat.info/convert/image/svg2raster.htm To convert SVG files to PNG and JPG, but i need a small program doing the same thing for windows. Prefer no install and...
1
SMRCA
by: SMRCA | last post by:
Hello to all, I am new in svg and don't have any idea of all functions first let me clear what I want to implement, I want to make a shape in dia that have one textbox, one rectangle on...
0
by: vaskarbasak | last post by:
Hi all, I used a png image for our application and it worked fine.But icon's quality is too bad.So our graphics designer made some svg image.I am trying to resize the image in order to fit all...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.