diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-01-09 16:47:29 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-01-09 16:47:29 +0000 |
| commit | 13abf3e6f87b4bc85708bfd8d8fe93deb76facdc (patch) | |
| tree | 8f5021ba5ae6123d242f5740c45611266a317071 /share | |
| parent | Fix a bug whith oposite handles on node move,and a little cleanup (diff) | |
| parent | Fix for bug #1266113 (xcf export only allows 90 dpi). (diff) | |
| download | inkscape-13abf3e6f87b4bc85708bfd8d8fe93deb76facdc.tar.gz inkscape-13abf3e6f87b4bc85708bfd8d8fe93deb76facdc.zip | |
update to trunk
(bzr r11950.1.233)
Diffstat (limited to 'share')
| -rw-r--r-- | share/extensions/gimp_xcf.inx | 2 | ||||
| -rwxr-xr-x | share/extensions/gimp_xcf.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/share/extensions/gimp_xcf.inx b/share/extensions/gimp_xcf.inx index 1f5f65949..10bcef627 100644 --- a/share/extensions/gimp_xcf.inx +++ b/share/extensions/gimp_xcf.inx @@ -11,12 +11,14 @@ <param name="guides" type="boolean" _gui-text="Save Guides">false</param> <param name="grid" type="boolean" _gui-text="Save Grid">false</param> <param name="background" type="boolean" _gui-text="Save Background">false</param> + <param name="dpi" type="int" min="1" max="3000" _gui-text="File Resolution:">90</param> </page> <page name="Help" _gui-text="Help"> <_param name="instructions" type="description" xml:space="preserve">This extension exports the document to Gimp XCF format according to the following options: * Save Guides: convert all guides to Gimp guides. * Save Grid: convert the first rectangular grid to a Gimp grid (note that the default Inkscape grid is very narrow when shown in Gimp). * Save Background: add the document background to each converted layer. + * File Resolution: XCF file resolution, in DPI. Each first level layer is converted to a Gimp layer. Sublayers are concatenated and converted with their first level parent layer into a single Gimp layer.</_param> </page> diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 35d0bbd4c..c2a8cb274 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -61,6 +61,10 @@ class MyEffect(inkex.Effect): action="store", type="inkbool", dest="layerBackground", default=False, help="Add background color to each layer") + self.OptionParser.add_option("-i", "--dpi", + action="store", type="string", + dest="resolution", default="90", + help="File resolution") def output(self): pass @@ -132,6 +136,8 @@ class MyEffect(inkex.Effect): # Layers area = '--export-area-page' opacity = '--export-background-opacity=' + resolution = '--export-dpi=' + self.options.resolution + if self.options.layerBackground: opacity += "1" else: @@ -149,7 +155,7 @@ class MyEffect(inkex.Effect): else: name = id filename = os.path.join(self.tmp_dir, "%s.png" % id) - command = "inkscape -i \"%s\" -j %s %s -e \"%s\" %s " % (id, area, opacity, filename, svg_file) + command = "inkscape -i \"%s\" -j %s %s -e \"%s\" %s %s" % (id, area, opacity, filename, svg_file, resolution) p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) return_code = p.wait() @@ -193,6 +199,7 @@ class MyEffect(inkex.Effect): ( (img (car (gimp-image-new 200 200 RGB))) ) + (gimp-image-set-resolution img %s %s) (gimp-image-undo-disable img) (for-each (lambda (names) @@ -223,7 +230,7 @@ class MyEffect(inkex.Effect): (gimp-image-undo-enable img) (gimp-file-save RUN-NONINTERACTIVE img (car (gimp-image-get-active-layer img)) "%s" "%s")) (gimp-quit 0) - """ % (filelist, namelist, hGList, vGList, gridSpacingFunc, gridOriginFunc, xcf, xcf) + """ % (self.options.resolution, self.options.resolution, filelist, namelist, hGList, vGList, gridSpacingFunc, gridOriginFunc, xcf, xcf) junk = os.path.join(self.tmp_dir, 'junk_from_gimp.txt') command = 'gimp -i --batch-interpreter plug-in-script-fu-eval -b - > %s 2>&1' % junk |
