export in web slicer extension doesnt work

Bug #707687 reported by Samuel Holly
This bug report is a duplicate of:  Bug #563722: Export layout extension error. Edit Remove
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Aurium

Bug Description

Inkscape 0.48
Windows 7 64-bit Home Premium

creating slicer rectangles works but on exporting the script returns:

 Traceback (most recent call last):

  File "webslicer_export.py", line 421, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 215, in affect

    self.effect()

  File "webslicer_export.py", line 110, in effect

    self.export_chids_of( self.get_slicer_layer() )

  File "webslicer_export.py", line 203, in export_chids_of

    self.register_unity_code( el, el_conf, parent_id )

  File "webslicer_export.py", line 261, in register_unity_code

    geo = self.get_relative_el_geometry(el,True)

  File "webslicer_export.py", line 302, in get_relative_el_geometry

    geometry = self.el_geo[el.attrib['id']]

KeyError: 'header'

(header is the ID of the slicer rectangle)

su_v (suv-lp)
tags: added: extensions-plugins
Revision history for this message
Alvin Penner (apenner) wrote :

On Windows XP, INkscape 0.48, I cannot duplicate the above message but I have an alternative crash message:

You must install the ImageMagick to get JPG and GIF.

Traceback (most recent call last):

  File "webslicer_export.py", line 421, in <module>

    e.affect()

  File "D:\Program Files\Inkscape\share\extensions\inkex.py", line 215, in affect

    self.effect()

  File "webslicer_export.py", line 116, in effect

    self.delete_the_temporary_svg()

  File "webslicer_export.py", line 158, in delete_the_temporary_svg

    os.remove( self.tmp_svg )

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\docume~1\\alvinp~1\\locals~1\\temp\\tmpkqsmgn.svg'

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Could both of you provide more information about the settings used in your test cases?

tags: added: win32
Revision history for this message
su_v (suv-lp) wrote :

Aurélio, could you please take a look?

Changed in inkscape:
assignee: nobody → Aurium (aurium)
Revision history for this message
Samuel Holly (samuel-holly) wrote :

Steps and settings I used:

1. create my web page layout
2. I go to Extensions>Web>Slicer>Create slicer rectangle (I give the rectangle a proper name, format: png, DPI:90, output format doesnt have an effect on the error)
3. When I have enough rectangles (each has a specific name), I go Extensions>Web>Slicer>Export layout pieces including HTML and CSS, in the dialog I check both the "with HTML and CSS" and "create folder if it doesnt exist" boxes and click "Apply".
4. an error dialog appears containing the message wrote above.

Revision history for this message
Alvin Penner (apenner) wrote :

In my case, under 'create slicer rectangle' I used
name = header
format = PNG
90 dpi
no color
select GIF tab

under 'export layout' I used
directory = C:\
no check boxes checked

Revision history for this message
Aurium (aurium) wrote :

This windows only problems is hard to test for me. I have no windows on my laptops, on my girlfriend laptop, on my mother desktop, on my work, or on my college sector. I'm on a happy free software life, so i need more of your help to get this working on windows.

Samuel, please, get the same SVG or any that throws the error on
  File "webslicer_export.py", line 302, in get_relative_el_geometry
    geometry = self.el_geo[el.attrib['id']]
...then run this command on the terminal:
inkscape --query-all yourfile.svg > query.txt
...after this, attach yourfile.svg and query.txt to this report.

Alvin, something is using/viewing the temporary svg file created by webslicer, but the images must be created before this. So, please, see if the images was created, and tell to us. Will be grate if you also discover what is using/viewing the temporary svg file.

Thanks!

Revision history for this message
Alvin Penner (apenner) wrote :

attached is the original svg file I am using

Revision history for this message
Alvin Penner (apenner) wrote :

plus the output files

Revision history for this message
Alvin Penner (apenner) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

plus the temporary file that was created but was not deleted

Revision history for this message
Alvin Penner (apenner) wrote :

hope this helps.

I do not know how to properly use this extension, could you provide a link to some instructions?

Revision history for this message
Aurium (aurium) wrote :

Hi Alvin, that really does not generate a header.png? >:-(

I must write some doc about this extension... soon... :-)

Revision history for this message
Aurium (aurium) wrote :

Alvin and Samuel, please try with this version of webslicer with some little changes.

Revision history for this message
Alvin Penner (apenner) wrote :

yes, that is much better, thanks.
I still get the error message about not being able to delete the temporary file, but now I get the attached png, which looks reasonable.

Alvin

Revision history for this message
Alvin Penner (apenner) wrote :
Revision history for this message
Samuel Holly (samuel-holly) wrote :

What should I do with the webslicer.tgz file? Sorry, I'm not a programmer. Thanks.

Revision history for this message
Aurium (aurium) wrote :

Hi Samuel,

You must to put the content of this tgz inside your inkscape extension dir.

To discover where is that dir, run "inkscape -x" in a terminal.

Revision history for this message
Samuel Holly (samuel-holly) wrote :

Thank you a lot. It works fine.

Revision history for this message
Alvin Penner (apenner) wrote :

@Samuel, did this new version resolve the problem for you?
if so, then I'll commit it to bzr sometime within the next week or so.

Revision history for this message
Samuel Holly (samuel-holly) wrote :

@Alvin, I still get the error message, which is now blank, but I also get the PNGs and html and css files that are OK, so it really did resolve the problem.

description: updated
Revision history for this message
Alvin Penner (apenner) wrote :

sorry, my mistake, I just realized the bzr version is already up-to-date, as of rev 9873, nothing needs to be updated. If there is no objection, I'll mark this as a duplicate of Bug 563722

Revision history for this message
David Pethes (dpethes) wrote :

The Windows error 'The process cannot access the file because it is being used by another process' is caused by the temporary file not being closed before delete attempt. Attached patch against webslicer_export.py fixes this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.