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 167506 - On failing to locate swap file calls an error message and gets stuck in loop
On failing to locate swap file calls an error message and gets stuck in loop
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.2.x
Other All
: Low minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-15 18:27 UTC by David Marrs
Modified: 2008-01-15 12:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Marrs 2005-02-15 18:27:45 UTC
Distribution/Version: XP Pro Service Pack 2

1) Followed initial instructions for set up.
2) When asked where I would like to create my swap file I renamed suggested
location to D:\David\.gimp(...)
3) On opening a file GIMP failed to find the said swap file, presumably because
I referred to a location that either didn't exist or couldn't be created. My
directory is actually D:\david\ (lower case). Windows doesn't distinguish
between cases as far as I'm aware, unless GIMP knows something I don't. :p

I presume that what's happened is that GIMP has looked for the directory,
presumed that it doesn't exist because it sees a capital D infront of (D)avid,
tries to create a new directory called D:\David but can't because Windows says
that D:\david already exists.

4) On failing to find the swap file GIMP brought up an error message box telling
me that my data may have become corrupted, that I should look for the swap file
manually, save a backup of the file I'm working on and exit.
5) I tred to do this but the message was stuck in an infinite loop. If I tried
to close it it would open again. If I tried to ignore it and save anyway I
couldn't because the message kept becoming the active window, preventing me from
appending the filename.
6) In the end I gave up, not being able to do anything, and forced a quit from
Window's task manager.
Comment 1 David Marrs 2005-02-15 19:00:16 UTC
On 3): It turns out I was under a misaprehension here. Gimp doesn't like
D:\david\.gimp-2.2 either. I realised, after trying, that I can't even create a
file begining with a .(period) anyway. I tried creating both a folder and an
ascii file manually and each time I was told by Windows that I must create a
file name.

So I dug out the script that GIMP that contained the filepath (which I found in
.gimp-2.2!) and manually altered the path to point to that file. In other words,
I changed it back to what gimp suggested in the first place.

So it seems that you have to use the default originally suggested by GIMP which
ISN'T MADE CLEAR at the time of creating the file. GIMP gives the impression you
can place the swap file wherever you like, presumably because you can in POSIX.
Still, a note in the README would at least be helpful for unsuspecting Windows
users...not that anyone ever reads READMEs. :p If you can find the time to
actually ammend this for the Windows version then thank you very much! :D
Comment 2 Michael Schumacher 2005-02-15 19:32:57 UTC
Windows doesn't have problems with directories and files starting with a '.'
(try it in a console window with mkdir, for example), only Explorer has. Please
let Microsoft know about this bug in Windows Explorer.

The page in the docs (http://docs.gimp.org/en/ch02.html#gimp-using-setup)
describing the setup dialogs and the text in the dialog itself  should mention
that the swap directory has to exist - it does if you keep the default, but
probably not if you change it.
Comment 3 weskaggs 2005-02-15 19:54:49 UTC
This bug report is a bit confusing.  What you are setting is not the "swap file"
but rather the "swap path", which is the folder that will hold the swap file. 
This folder must exist, must be a folder rather than a file, and must be
writable, otherwise you will get errors.  It isn't clear whether some of your
problems come from specifying a file rather than a folder.

But in any case I think this is a legitimate bug report, because GIMP should
really check the validity of the swap path before accepting it -- and the
documentation should be clearer too.
Comment 4 Sven Neumann 2005-02-15 22:08:51 UTC
GIMP does check the validity of the swap path. The icon next to the folder in
the prefs turns red if you manage to enter a non-existant folder. If you still
accept it, GIMP will show a clear warning message the next time you start it. I
don't think this needs to be improved further.
Comment 5 Nathan Summers 2005-02-15 22:40:32 UTC
Evidentially the meaning of the text turning red isn't obvious to some users. 
It may especially be difficult for color-blind users.  According to chapter 8 of
the HIG:

* Do not use color as the only means to distinguish items of information. All
such information should be provided by at least one other method, such as shape,
position or textual description.

* Select colors carefully. When they need to be recognizably different, select
the light colors from orange, yellow, green or blue-green, and darker colors
from blue, violet, purple or red, as most people affected by color-blindness
already see blue, violet, purple and red as darker than normal.

It seems to me like the best solution is to stat the directory, and offer to
(recursively) create it if you try to specify a directory that does not exist.
Comment 6 Sven Neumann 2005-02-15 23:04:41 UTC
A color-blind user would not use the default GTK+ theme. Nathan, have a look at
the code and you will figure that your suggestion is not exactly trivial to
implement.
Comment 7 Sven Neumann 2005-02-15 23:18:40 UTC
Probably the best place to implement a change here would be in the check for the
swap file that is being performed at startup. Instead of only informing the user
that the swap directory does not exist, we could offer to create it.
Comment 8 Sven Neumann 2005-03-22 23:21:15 UTC
2005-03-23  Sven Neumann  <sven@gimp.org>

	* app/base/tile-swap.c (tile_swap_init): create the swap directory
	if it doesn't exist. Will still fail if the parent directory is not
	available. Still good enough to close bug #167506.

	* app/app_procs.c: tweaked error message.