Alessandro,
It seems that this might be best handled in a program external to
Inkscape. That is export one big .png from inkscape and then crop
it in another program that supports batch processing or can be called
from an external script.
Imagemagick comes to mind.
It plays nice with scripts and can probably do what you want using
the convert
I may be way off base here (and probably off topic ITO the purpose
of the list), but it might be a better solution to your problem.
Good Luck,
Jamie
"It is a mistake to think you can solve any major problems with just
potatoes."--Douglas Adams
__________________
Jamie Kimberley
Postdoctoral Fellow
Department of Mechanical Engineering
The Johns Hopkins University
Office: 410.516.5162
Mobile: 217.621.8272
Fax: 410.516.4316
E-Mail:jamie.kimberley@...1884...
On Fri, 5 Dec 2008, Alessandro Antonello wrote:
Hi, Mr. Byak.
I know that, for a vector image, the width and height in pixels is meaninless.
It is built with a series of PNG images and text objects. About 2900 in each
file. I have to slice every file in 29,232 parts. Each part will have 180px
width and 150px height. Also, every part must be named with their source X and
Y coordinates.
The source SVG is not too big, in bytes. It has about 20 MB because of the
series of PNG imagens on it. It dosn't have any efect like blur or other,
transparency or other thing. Well, the background color for the page is
nothing, if this means something.
Maybe I did something wrong in the batch script. It is so simple. Maybe I can't
see something obvius.
--------------------------------------------------------------------------------
for /l %%Y in (0,150,37650) do (
for /l %%X in (0,180,20700) do (
call :export_file %%Y %%X
)
)
goto :EOF
rem %1 is Y coord. %2 is X coord.
:export_file
set /a RIGHT=%2 + 180
set /a TOP=%1 + 150
inkscape -e ../target-dir/%2x%1.png -a %2:%1:%RIGHT%:%TOP% source.svg
goto :EOF
--------------------------------------------------------------------------------
I can see that a problem in this script is that every time it calls a new
instance of Inkscape. This is a problem. I read about the '--shell' command
line option but seams to me that it is not working. So, I had no alternatives.
There is something else that can be done?
Thanks,
Alessandro Antonello
--------------------------------------------------
From: "bulia byak" <buliabyak@...400...>
Sent: Thursday, December 04, 2008 2:46 PM
To: "Alessandro Antonello" <aleantonello@...19...>
Cc: <inkscape-devel(a)lists.sourceforge.net>
Subject: Re: [Inkscape-devel] Script to export images
> On Thu, Dec 4, 2008 at 12:31 PM, Alessandro Antonello
> <aleantonello@...19...> wrote:
>> Hi, All.
>>
>> I already wrote this question in the inkscape-user list but no one came to
>> me with a good solution. My problem is that I have a SVG image too big. In
>> fact is more than one. They are five SVG files with size of 20880 pixels
>> width by 37800 pixels height. I have to export PNG files of slices that must
>> have 180 pixels width by 150 pixels height.
>
> This is rather meaningless measure of bigness for vector images :)
> How many objects? Nodes? Bytes in SVG? Does it use blur (most
> important!), transparency, gradients?
>
>> batch file (I am using Windows XP with Inkscape 0.46) but it is too slow. I
>> left it running almost 16 hours strait and it didn't finished the first file
>> yet.
>
> Looks like it has blur or other filters. In that case, you would need
> to download the latest dev build, it is much faster than 0.46 in
> exporting blur.
>
> --
> bulia byak
> Inkscape. Draw Freely.
>
http://www.inkscape.org
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel(a)lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel