Inkscape-JPEG-export-extension
Inkscape-JPEG-export-extension copied to clipboard
no jpg pexport in Linux
- Extension does not export any file in Linux (maybe due to different path format?)
- It should pick up the name of the svg file as default for jpg export
- Export file location must be selected in GUI otherwise using the extension becomes more complex than simply exporting as png / convert / delete in a file browser by any other helper
Hi @kzoli429, thanks for your suggestions.
I will try to answer to your points in order:
- Extension has been developed for my linux box, so it should export in linux (in my ubuntu, debian and mint computers it works), so if it is not exporting for you it must be some sort of bug. Can you provide more details? Any error messages?
- The extension can export the whole svg but also single components or selections, so I don't think it is wise to use the svg name. If you look to the standard png export you will notice that it does not suggest the file name to be equal to the svg name but it uses the single object name as default (eg rect37849.png).
- In the inkscape extension api (as far as I know) there is no way to have a file selection dialog (look to the core extensions and you will see that no one has a file dialog), so it is not possible to do that.
Hi,
- I use an uptodate 64 bit version of Arch Linux. I provide a full path with filename for your extension, still no output file and no error message. It seems to be OK when running, but no output.
- My idea is obviously different. I also feel sorry for the way of naming for png export.
- Sorry to learn. Regards, kzoli429
On 02/23/2016 10:56 AM, Giacomo Mirabassi wrote:
Hi @kzoli429 https://github.com/kzoli429, thanks for your suggestions.
I will try to answer to your points in order:
- Extension has been developed for my linux box, so it should export in linux (in my ubuntu, debian and mint computers it works), so if it is not exporting for you it must be some sort of bug. Can you provide more details? Any error messages?
- The extension can export the whole svg but also single components or selections, so I don't think it is wise to use the svg name. If you look to the standard png export you will notice that it does not suggest the file name to be equal to the svg name but it uses the single object name as default (eg rect37849.png).
- In the inkscape extension api (as far as I know) there is no way to have a file selection dialog (look to the core extensions and you will see that no one has a file dialog), so it is not possible to do that.
— Reply to this email directly or view it on GitHub https://github.com/giacmir/Inkscape-JPEG-export-extension/issues/8#issuecomment-187630413.
This extension requires that there is the convert
command in path. Do you have imagemagick installed?
sure
On 02/24/2016 05:16 PM, Giacomo Mirabassi wrote:
This extension requires that there is the |convert| command in path. Do you have imagemagick installed?
— Reply to this email directly or view it on GitHub https://github.com/giacmir/Inkscape-JPEG-export-extension/issues/8#issuecomment-188328861.
Can you please try this?
- open inskcape
- draw a square
- select it
- run jpegexport plugin (specify an output path including file name, leave the rest as default)
Then please tell me if:
- the jpeg file was created (maybe it's a problem with a specific object type)
- there is a
jpinkexp.png
file in /tmp
Thank you
No answer in 6 months, closing.
Hello, I run into the same issue, the image went to /tmp instead of the specified path. The image is called jpinkexp.png I do have image magick installed.
command works. convert -quality 100 -density 90 source.png destination.jpg
Hi, on windows just install ImageMagick and edit the jpegexport.py. i did some minimal changes:
def tojpeg(self,outfile):
tmp = self.getTmpPath()
if os.name == 'nt':
outfile = outfile.encode('string-escape')
# set the ImageMagick command to run based on what's installed
if find_executable('magick'):
command = "magick \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile)
# inkex.debug(command)
elif find_executable('convert'):
command = "convert \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile)
# inkex.debug(command)
else:
inkex.errormsg(_('ImageMagick does not appear to be installed.'))
exit()
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return_code = p.wait()
f = p.stdout
err = p.stderr
# inkex.debug(return_code)
def getTmpPath(self):
"""Define the temporary folder path depending on the operating system"""
if os.name == 'nt':
return os.getenv('TEMP') + '\\'
else:
return '/tmp/'
At first i had problems but now i works like exspected
Thanks a lot @vmario89 for this patch. You should send a PR with this for Windows.