Sounds great. Sorry I missed you when you were asking about Win32 and the Buildtool. So I tried building it and have it mostly done now.
From a portability side, I have found a couple of thing that need to be tweaked.
In imagemagick.cpp, the first include should be #include <libintl.h> This will work on both Linux and windows and will provide the definition for libintl_printf() that Windows needs.
strndup, stpcpy and strnlen are Linux-only
strndup can be replaced with g_strndup()
For stpcpy() , which returns the tail of the destination string, I would either replace it with some pointer-walking code, like below, or preferably use a Glib::ustring as an output buffer and append the data to it. Slightly slower, but a LOT safer.
I hope Thunderbird doesn't screw up the formatting too much :) ===========================
int formatted_len = raw_len * 78 / 76 + 100; char *formatted = new char[formatted_len]; char *formatted_i = formatted; const char *src;
for (src = "data:image/" ; *src ; ) *formatted_i++ = *src++; for (src = effectedImage.magick().c_str() ; *src ; ) *formatted_i++ = *src++; for (src = ";base64, \n" ; *src ; ) *formatted_i++ = *src++;
int col = 0; while (*raw_i) { *formatted_i++ = *raw_i++; if (col++ > 76) { *formatted_i++ = '\n'; col = 0; } }
if (col) *formatted_i++ = '\n';
*formatted_i = '\0';
======================= /* Being lazy, I prefer this */ Glib::ustring buf = "data:image/"; buf.append(effectedImage.magick()); buf.append(";base64, \n"); int col = 0; while (*raw_i) { buf.push_back(*raw_i++); if (col++ > 76) { buf.push_back('n'); col = 0; } } if (col) buf.push_back('\n');
const char *formatted = (const char *)buf.c_str();
======================
Christopher Brown wrote:
Dear fellow Inkscape users,
My Google Summer of Code project is now in SVN. My project is "Raster Functionality in Inkscape," which involved integrating ImageMagick libraries into Inkscape, in order to manipulate bitmaps from inside Inkscape.
You'll have to install ImageMagick with Magick++ support (which is default) in order for these new extensions to work.
They can be accessed under the sub-menu "Raster" in the extensions drop-down menu.
The code is not quite in its final state--I am still perfecting and smoothing it out--but it's functional and I'd love to get feedback from all of you, especially from Windows users (because I have not tested it on that OS yet).
Thank you all,
-Christopher Brown