473,394 Members | 1,759 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,394 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 27698

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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.