inconvenient default path for extension 'Extract Image…'

Bug #554734 reported by su_v on 2010-04-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Low
jazzynico

Bug Description

Inkscape 0.47+devel r9287 on OS X 10.5.8

The default path+filename of the extension 'Extract Images…' is given as 'none' in the corresponding inx file. Unchanged, this results in extracting the image into the shared extensions directory (which - as of recent revisions - is the working directory of the spawned python process). The default filename extension (*.png) is not added (contrary to the explanation in the dialog).

This extension should either default to $HOME or 'Extract Image…' should be moved from the extension system to a native Inkscape command so that the images can be saved in the same location as the SVG document they have been embedded in. AFAIU it is not possible for script extensions to obtain the actual full path of the current SVG file opened in Inkscape - extensions only see a copy of the file in $TMP.

The extension 'Export Layer Slices…' (see bug #169985 “Slicing pluging (for web and whatnot)”) defaults to $HOME (or '~') for the export path - maybe the extension 'Extract Imges…' could be changed similarly (i.e. if the filename is relative, make it relative to $HOME and not to the working directory of the python process) - until extracting images is handled by Inkscape internally?

Related branches

su_v (suv-lp) on 2010-04-03
summary: - inconvenient default path for extension 'Extract Images…'
+ inconvenient default path for extension 'Extract Image…'
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape bzr rev. 9315.
The filename extension is correctly set on Windows, but the image is extracted in the share\extension folder.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
jazzynico (jazzynico) wrote :

~suv, I've tried with embedded PNGs and JPGs, and had no extension issue. Could you please attach a file showing this issue.
I'm working on the default folder improvement, but it needs more testing.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Medium → Low
milestone: none → 0.48
status: Confirmed → In Progress
su_v (suv-lp) wrote :

Inkscape 0.47+devel r9331
- Python 2.5.1
- default preferences (new)
- no user extensions (~/.config/extensions renamed)

steps to reproduce:
1) open attached file
2) select embedded image
3) 'Extensions > Images > Extract Image…'
4) click 'Apply' (default entry unchanged - 'none')

expected result:
'none.png' saved in current working directory of python process

actual result:
'none' saved in current working directory of python process

su_v (suv-lp) wrote :

sorry, typo:
- - no user extensions (~/.config/extensions renamed)
+ - no user extensions (~/.config/inkscape/extensions renamed)

jazzynico (jazzynico) wrote :

Committed in bzr revision 9336.

* The extension bug is fixed (due to a problem when the file type of the embedded image was uppercase).
* All relative paths (or filenames without path) are now relative to the user's home directory.
* New feedback dialog showing the path of the extracted image when done.
* Some extra description.

Tested on Windows XP (python 2.5) and Ubuntu 9.10 (python 2.6).
Please test!

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) wrote :

Fix confirmed with Inkscape 0.47+devel r9336 on OS X 10.5.8 (Python 2.5.1)

- adds file name extension
- defaults to $HOME
- relative path is relative to $HOME ('~')
- feedback about location of extracted image is very appreciated (imho ;)

thanks a lot! :)

jazzynico (jazzynico) on 2010-08-24
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers