Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
imagemagick renders rastergraphic images. This projects first aim was to implement vectorgraphic capabilities for Drupal, that is why Drawing has built-in SVG toolkit.
I was planning to implement php-gd, and still am, but that requires an extensive amount of work, for which i have no time at the moment. But any contribution is very welcome.
I've been looking into starting a GD implementation for D6 today, and from having a bit of a think about it I don't think using the theme functions so heavily is going to be suitable. I may have to tinker with a few things, I'll see how it goes..
Goods news is a bit of work can be done from the drupal core http://api.drupal.org/api/file/includes/image.gd.inc/6
Just having a bit of a dillema on what exactly that theme function should return.
The SVG toolkit returns the xml for the SVG, but something like returning the GD resource doesn't seem appropriate. The user will want the path or html for the image, which means the toolkit has to save the images somewhere first, kind of like the textimage module.
But will this design make it too inconsistent with the SVG toolkit?
Yes! My first masterpiece made with the GD toolkit I'm making ... 23 because it my 23rd attempt at generating an image... well at least the 23rd attempt since the file naming code started working....
I'm not very creative, I know, but I've only implemented the 'line' theme function so far.
I've implemented a few more theme functions. Getting closer but the hard stuff is still around the corner. If I can write an interpreter for SVG path syntax it's smooth sailing...
Well I'm slowly adding more to this, I've been distracted by a pile of issues on other modules, and paid work, but it is coming along. I have got transformations in there now, and file support should be easy. I found some GPL c code for parsing svg path syntax into bezier lines and I have some code to draw bezier lines in GD - so hopefully this means I can write a function to do paths.
An update: I added transformations, files, and paths (!) but it's all blowing up at the moment when I try to render the druplicon canvas, got a lot of debugging ahead of me :P
Comments
Comment #1
snufkin commentedimagemagick renders rastergraphic images. This projects first aim was to implement vectorgraphic capabilities for Drupal, that is why Drawing has built-in SVG toolkit.
I was planning to implement php-gd, and still am, but that requires an extensive amount of work, for which i have no time at the moment. But any contribution is very welcome.
Comment #2
danielb commented+1 for php-gd
I will probably do that eventually if you don't get around to it,
I wonder if there is some cheeky way to just convert SVG to a GD image
Comment #3
danielb commentedI've been looking into starting a GD implementation for D6 today, and from having a bit of a think about it I don't think using the theme functions so heavily is going to be suitable. I may have to tinker with a few things, I'll see how it goes..
Comment #4
danielb commentedGoods news is a bit of work can be done from the drupal core http://api.drupal.org/api/file/includes/image.gd.inc/6
Just having a bit of a dillema on what exactly that theme function should return.
The SVG toolkit returns the xml for the SVG, but something like returning the GD resource doesn't seem appropriate. The user will want the path or html for the image, which means the toolkit has to save the images somewhere first, kind of like the textimage module.
But will this design make it too inconsistent with the SVG toolkit?
Comment #5
sharique commentedFiles can be saved in files folder or a separate folder under files folder.
--
Sharique
Comment #6
danielb commentedWell it is needed so I think that's what I'll do, if people desire the SVG module to do something similar I am sure they will say something.
Comment #7
danielb commentedYes! My first masterpiece made with the GD toolkit I'm making ... 23 because it my 23rd attempt at generating an image... well at least the 23rd attempt since the file naming code started working....
I'm not very creative, I know, but I've only implemented the 'line' theme function so far.
Comment #8
danielb commentedI've implemented a few more theme functions. Getting closer but the hard stuff is still around the corner. If I can write an interpreter for SVG path syntax it's smooth sailing...
Comment #9
snufkin commentednice work
Comment #10
danielb commentedWell I'm slowly adding more to this, I've been distracted by a pile of issues on other modules, and paid work, but it is coming along. I have got transformations in there now, and file support should be easy. I found some GPL c code for parsing svg path syntax into bezier lines and I have some code to draw bezier lines in GD - so hopefully this means I can write a function to do paths.
Comment #11
danielb commentedAn update: I added transformations, files, and paths (!) but it's all blowing up at the moment when I try to render the druplicon canvas, got a lot of debugging ahead of me :P
Comment #12
danielb commented