After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 148140 - 2.0 does not decode URLs dropped from DFM
2.0 does not decode URLs dropped from DFM
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.0.x
Other All
: Normal blocker
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
: 148371 (view as bug list)
Depends on: 148420
Blocks:
 
 
Reported: 2004-07-22 02:32 UTC by Petter Sundlöf
Modified: 2004-08-04 17:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Petter Sundlöf 2004-07-22 02:32:42 UTC
open("file:///data/audio/UltraPloj/%D6ver%F6sa/Omslag/Cancerpl%E4ttar.xcf",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

A file in a iso-8859-1 encoded path dragged via DFM to GIMP 2.0.3.
Same when dragging from Nautilus.
Comment 1 Petter Sundlöf 2004-07-22 02:34:51 UTC
The file fails to open, giving these error messages:

Dialogue 1: "GIMP Message: Opening
'file:///data/audio/UltraPloj/%D6ver%F6sa/Omslag/Avfallsblodpump.xcf' failed:
Plug-In could not open image.".
Dialogue 2: "GIMP Message: Could not open
'file:///data/audio/UltraPloj/%D6ver%F6sa/Omslag/Avfallsblodpump.xcf' for
reading: No such file or directory".
Comment 2 Petter Sundlöf 2004-07-22 02:40:28 UTC
When opening an ASCII file either from drag and drop or open dialogue I get:


open("/home/odd/NL/Cementkulle.xcf", O_RDONLY|O_LARGEFILE) = 5
Comment 3 Petter Sundlöf 2004-07-22 03:18:32 UTC
Downgrading to libglib2.0-0 (2.4.2-1) (Debian) solved this.
Comment 4 Dave Neary 2004-07-22 07:34:14 UTC
Sounds like a G_BROKEN_FILENAMES issue.

The GIMP assumes UTF8 encoded filenames everywhere, unless G_BROKEN_FILENAMES is
set. And starting from glib 2.4, that changed to G_FILENAME_ENCODING. 

Try running the GIMP after setting G_FILENAME_ENCODING to iso8859-1.

Cheers,
Dave.
Comment 5 Petter Sundlöf 2004-07-22 10:44:31 UTC
I've tried that, and setting that has no effect.
Comment 6 Michael Natterer 2004-07-22 11:00:59 UTC
This has nothing to do with G_BROKEN_FILENAMES or G_FILENAME_ENCODING.
It's glib that has changed behavior immediately after the 2.4.2
release:

2004-06-07  Federico Mena Quintero  <federico@ximian.com>

  * README.in: Added a note about the changes below.

  Merge from HEAD:

  Fixes #140532.

  * glib/gconvert.c (is_asciialphanum): Renamed from
  is_escalphanum(); ensures that this is an ASCII character.
  (is_asciiescalpha): Renamed from is_escalpha().
  (hostname_validate): Use the two functions above.
  (g_filename_to_uri): Don't convert the filename to UTF-8.
  (g_filename_from_uri): Don't convert the filename from UTF-8.


Even though it's quite strange for the functions to change 
behavior in the middle of a stable branch, we will have to
add a runtime check here.
Comment 7 Sven Neumann 2004-07-25 20:56:38 UTC
*** Bug 148371 has been marked as a duplicate of this bug. ***
Comment 8 Sven Neumann 2004-07-26 11:41:08 UTC
The glib problem is handled in #148484. We keep this bug report open so that we
remember to check the code after glib has been fixed.
Comment 9 Sven Neumann 2004-07-30 21:05:07 UTC
glib-2.4.5 has been released. We should check if we need to do any changes to
out URL handling before we do 2.0.4. Setting severity to blocker.
Comment 10 Michael Natterer 2004-07-31 14:41:15 UTC
After a first glance it looks as if we just need to change the DND url
decoding stuff because all other places don't care about the contents
of the URI.

There won't be a fix for glib == 2.4.4 however. We should pop a
warning on startup which informs the user that any non-ascii
filename can't be opened with that version of glib.

(and no, there is no workaround :-( ...)
Comment 11 Ari Pollak 2004-08-01 21:03:45 UTC
Not sure if this is related, but I also have a report of this happening
(http://bugs.debian.org/262718):

I see this message telling me to set G_FILENAME_ENCODING.
So
$ G_FILENAME_ENCODING=$LC_CTYPE gimp /tmp/19990716cement_big.jpg
GIMP: Error parsing internal buffer: while parsing token
'web-browser': Conversion from character set 'UTF-8' to 'zh_TW.Big5'
is not supported

Segmentation fault

Comment 12 Anatoly Yakushin 2004-08-03 16:54:57 UTC
Glib 2.4.5 fixed this bug.
Comment 13 Anatoly Yakushin 2004-08-03 16:55:37 UTC
Glib 2.4.5 fixed this bug.
Comment 14 Michael Natterer 2004-08-04 17:13:23 UTC
Fixed the remaining DND issue in both branches:

2004-08-04  Michael Natterer  <mitch@gimp.org>

	Allow URI drops from apps linked against GLib < 2.4.4 to GIMP
	linked against GLib >= 2.4.5. Fixes bug #148140.

	* app/core/gimp-utils.[ch]: added gimp_check_glib_version().

	* app/widgets/gimpselectiondata.c: added runtime check for GLib
	versions that encode file:// URIs correctly (>= 2.4.5). For older
	(broken) GLibs, leave the code path as is, for newer (fixed) ones,
	perform an additional check if the dropped URI is in the (broken)
	escaped-UTF-8 format and convert it to local filename encoding.

	* app/gui/gui.c: warn the user that non-ASCII filenames can't
	be used when linked against GLib 2.4.4.