setting resolution AND width or height while exporting

Post questions on how to use or achieve an effect in Inkscape.
smithcferg
Posts: 2
Joined: Thu Apr 29, 2010 6:56 am

setting resolution AND width or height while exporting

Postby smithcferg » Thu Apr 29, 2010 7:39 am

It is my understanding that the inkscape commandline export command currently will only allow me to control the export width, or the export dpi, but not both. Is that true? Any workarounds so that I can do both?

I have a situation where I need to export several pngs for each of many inkscape svgs in a directory. I need to specify width values independent of dpi resolution values for these exports. My plan is to automate the export of these pngs. I want to run a batch file against this directory - it will read values from a csv file that will tell the batch file what the unique width and dpi values should be for each svg and export accordingly. As the svgs are revised there will always be current exported pngs of the correct resolution and size for the output documentation they will be used with.

Currently I am working around this issue in inkscape using a manual method: calling up the export bitmap dialog, inserting the desired png dpi export value value in the dialog, resizing the selected object to be exported to the desired width (maintaining aspect ratio), exporting the svg object as png, then repeating this whole process for the next png to export. How can I do this from the command line?

Hope I explained my problem clearly. Any help would be appreciated!

Thanks in advance,

Craig

smithcferg
Posts: 2
Joined: Thu Apr 29, 2010 6:56 am

Re: setting resolution AND width or height while exporting

Postby smithcferg » Thu Apr 29, 2010 8:36 pm

Anyone?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: setting resolution AND width or height while exporting

Postby brynn » Thu Apr 29, 2010 9:44 pm

Welcome Craig!
I apologize for the delay. Most issues we handle are with using Inkscape in it's interface, so there aren't a lot of members/visitors here who understand and can help with command line uses. (For example, I do know what the command line is, but that's as far as it goes for me :oops: ) That doesn't mean no one here can help, it just means that it might take a few days before the people with the right knowledge see your message.

I'm not sure about this, but you might find some helpful info by searching Launchpad (Inkscape's bug tracker). Not that I think your issue is a bug (although I suppose it's possible), but because command line issues may be discussed in more depth in relation to a bug. I guess I'm thinking you might pick up some helpful info, sort of like collateral info ( :mrgreen: )? Yeah, I know it's a stretch, but while you're waiting....I know I often learn a lot by continuing to search while waiting for replies.

Anyway, please be patient. I'm sure you will get some responses before too much longer.
All best :D

PS -- I'm in a rush at the moment and don't have time to look this up. I know that a (raster) graphics program called IrfanView is capable of batch operations, like batch file format conversions (like 50 JPGs converted to 50 PNGs) -- can't remember if it handles SVG. Also, I've lost my link to the website, but should be simple to search out. So just a fletting thought as I rush away. (Sorry :roll:)

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: setting resolution AND width or height while exporting

Postby sas » Fri Apr 30, 2010 2:53 am

Perhaps the simplest way to do it from the command line would be to use Inkscape to export at the correct width and height, and then use a different program to change the dpi. For example, pngcrush has a -res option for setting dpi.


Return to “Help with using Inkscape”