gimp/app/file
Jehan 042d3051c6 app, libgimpbase: do not try to open a non existing file.
Now that GimpParamSpecFile makes file validation depending on the action
set in the param spec, when trying to open a non-existing file (which
can happen through GUI, for instance when opening through the Document
History dockable or Open Recent menu), we had a quite obscure error
about a value "out of range" used "for argument 'file' (#2, type
GFile)", which is because core tried to set the GFile for a non-existing
file into the second parameter of the plug-in PDB. This is not a very
nice error for end-users.

The old error was much nicer as it used to say things like:

> Could not open '/path/not/existing.png' for reading: No such file or directory

But in fact, this string came from the plug-in, which means:

* first that the error can be different depending on the format
  (inconsistency of error message);
* depending on bugs in plug-ins, it may just crash or return no error
  messages;
* finally we were making a useless call to a load plug-in while we
  should already know from core that it won't work.

The new message is something like:

> Error when getting information for file "/path/not/existing.png: No such file or directory

This error is generated by core, so it will always be consistently the
same, is understandable too and the plug-in won't even be called.

As a side related fix, I updated the GimpParamSpecFile validation to
only validate local files, just like we do in core. Remote files can
always be set (and we let plug-ins handle them), at least for the time
being.
2025-01-23 20:04:54 +01:00
..
file-import.c app, libgimp, plug-ins: move Orientation metadata handling into core. 2020-09-24 12:43:41 +02:00
file-import.h Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
file-open.c app, libgimpbase: do not try to open a non existing file. 2025-01-23 20:04:54 +01:00
file-open.h app, libgimp, plug-ins: improve GimpVectorLoadProcedure workflow. 2024-06-08 18:58:06 +02:00
file-remote.c app: don't use the deprecated GTimeVal in file-remote.c 2019-09-14 12:22:04 +02:00
file-remote.h Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
file-save.c app, libgimp*, pdb, plug-ins: review and enhance MR !1549. 2024-08-18 22:46:47 +02:00
file-save.h Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
file-utils.c app, libgimp, pdb, plug-ins: improve and rename gimp_file_save_thumbnail() to… 2025-01-21 20:31:27 +01:00
file-utils.h pdb, app, libgimp, plug-ins: replace most PDB filenames/URIs by GFile 2019-09-11 21:48:34 +02:00
gimp-file.h Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
meson.build Meson port. 2019-09-11 16:42:04 +02:00