empty eps file export fails to re-import back into inkscape
Initially reported by @monikajaskolka in inbox#5440 (moved) (issue focuses on a mac specific issue).
Steps to reproduce:
- Open a new document in Inkscape
- Save the blank document as an EPS named drawing.eps (drawing.eps)
- Close document
- Open drawing.eps
What happened?
- The following error, which makes sense because no objects are inside the eps file (so
-dEPSCrop
fails).
Traceback (most recent call last):
File "ps_input.py", line 41, in <module>
PostscriptInput().run()
File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex/base.py", line 130, in run
self.load_raw()
File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex/extensions.py", line 119, in load_raw
document = self.call(input_file, output_file) or output_file
File "ps_input.py", line 38, in call
call('ps2pdf', crop, input_file, output_file)
File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex/command.py", line 188, in call
stdout = _call(program, *args, **kwargs)
File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex/command.py", line 172, in _call
raise ProgramRunError(f"Return Code: {process.returncode}: {stderr}\n{stdout}\nargs: {args}")
inkex.command.ProgramRunError: Return Code: 1: b'Error: /configurationerror in --setpagedevice--\nAdditional information: [/PageSize [0 0]]\nOperand stack:\n --nostringval-- (%%BoundingBox: 0 842 0 842) --dict:1/2(ro)(G)-- --nostringval-- --nostringval-- (%%BoundingBox: 0 842 0 842) 1 0 842 false --dict:1/1(L)--\nExecution stack:\n %interp_exit .runexec2 --nostringval-- 0Policy --nostringval-- 2 %stopped_push --nostringval-- 0Policy 0Policy false 1 %stopped_push 1990 1 3 %oparray_pop 1989 1 3 %oparray_pop 1988 1 3 %oparray_pop 0Policy 1977 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- 0Policy --nostringval-- 2 %stopped_push --nostringval-- %ztokenexec_continue (scanner state) 0Policy 0Policy 0Policy 0Policy 1986 8 3 %oparray_pop 0Policy 1984 11 3 %oparray_pop 0Policy 1938 10 3 %oparray_pop 0Policy 1937 16 3 %oparray_pop 0Policy --dict:1/10(L)-- 0Policy 13 %dict_continue 1934 19 3 %oparray_pop\nDictionary stack:\n --dict:731/1123(ro)(G)-- --dict:0/20(G)-- --dict:79/200(L)--\nCurrent allocation mode is local\nLast OS error: Invalid argument\nCurrent file position is 200\nGPL Ghostscript 9.54.0: Unrecoverable error, exit code 1\n'
b''
args: ['/usr/local/bin/ps2pdf', '-dEPSCrop', '/Users/monika/Desktop/drawing.eps', '/var/folders/pj/q9mg94z16jqghz31yzg82t7c0000gn/T/inktmpabx37rsw/output.pdf']
What should have happened?
- A nicer error message, and maybe just attempt to open the file without cropping the eps file, even though it is non-standard
Inkscape version
- Still present in latest extensions, and Inkscape 1.2-dev (71f65390d8, 2021-08-04) Linux Mint 20