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 399988 - Exits without any appropriate error message or exit code if image is not accessible
Exits without any appropriate error message or exit code if image is not acce...
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: Lucas Rocha
EOG Maintainers
: 326825 374155 394755 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-23 22:34 UTC by Sven Arvidsson
Modified: 2007-02-26 22:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
fix for the trunk (1.15 KB, patch)
2007-01-24 03:54 UTC, Claudio Saavedra
committed Details | Review

Description Sven Arvidsson 2007-01-23 22:34:25 UTC
This bug was filed in the Debian BTS.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391582

"If you start eog with an image file name on the command line and the image is unaccessible for eog e.g. because belonging to another user and having rights set to 600 (as it's the case with screenshots made during the graphical 
install and you want wo view them afterwards with your freshly created normal user), it exits with exit code zero and 
without any error message.

The same happens if you select such a file from the open dialog and try to open it: eog exits and gives not any hint why it did that nor what caused the exit. Besides that: If you try to open an unreadable file via the open dialog, 
the program should not exit completely but instead return to the open dialog and showing an appropriate error 
message."
Comment 1 Claudio Saavedra 2007-01-24 00:44:19 UTC
Confirming. Behavior in trunk is like in bug #326825 and bug #394755, though I can't say yet the problem is the same. I will investigate further.
Comment 2 Claudio Saavedra 2007-01-24 01:33:10 UTC
The reason is that when an image is not correctly loaded, for some reason, somebody thought it would be a good idea to simply call gtk_main_quit (). See the following code fragment:

static void
job_prepare_model_finished (EogJob *job, gpointer data, GError *error)
{
	LoadContext *ctx = (LoadContext*) data;
	
	if (eog_job_get_status (job) == EOG_JOB_STATUS_FINISHED &&
		eog_job_get_success (job))
	{
		g_object_ref (ctx->img_list);
		
		assign_model_to_window (ctx->window, ctx->img_list);
	} 
	else {
		g_error_free (error);
		gtk_main_quit ();
	}
}

I'll cook a fix for this. I'm really surprised by this.
Comment 3 Claudio Saavedra 2007-01-24 01:43:11 UTC
*** Bug 326825 has been marked as a duplicate of this bug. ***
Comment 4 Claudio Saavedra 2007-01-24 01:49:16 UTC
*** Bug 394755 has been marked as a duplicate of this bug. ***
Comment 5 Claudio Saavedra 2007-01-24 03:54:53 UTC
Created attachment 81038 [details] [review]
fix for the trunk

With this patch, EOG will show an error message telling the reason why the image couldn't be loaded, and the program will close only if there are no EOG windows already open. I'll commit it to the trunk, but will leave it here in case is useful for Debian or other distros.
Comment 6 Claudio Saavedra 2007-01-24 04:41:16 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.

2007-01-24  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

        * shell/main.c: (job_prepare_model_finished): Show an error message
        instead of closing the program if the image loading has failed.
        Fixes bug #399988.

(still need to figure out a fix for the eog-ng branch, will leave this bug open in the meantime)
Comment 7 Lucas Rocha 2007-01-24 08:23:19 UTC
Claudio, I'm already working on those issues in eog-ng. See "Implement new error/warning UI stuff" in the task list. There are other related bugs listed there.

Leave bug open != RESOLVED/FIXED, right!?
Comment 8 Felix Riemann 2007-01-24 11:36:24 UTC
*** Bug 374155 has been marked as a duplicate of this bug. ***
Comment 9 Claudio Saavedra 2007-01-24 12:37:27 UTC
(In reply to comment #7)
> Claudio, I'm already working on those issues in eog-ng. See "Implement new
> error/warning UI stuff" in the task list. There are other related bugs listed
> there.

Great. Then I pass the ball to you.

> 
> Leave bug open != RESOLVED/FIXED, right!?
> 

Heh, I din't close it! The stock message did it for me ;-)

ps: please Lucas, assign to you all the bugs you are already working on (at least in the wiki), to avoid duplicating work. Thanks.
Comment 10 Lucas Rocha 2007-01-24 13:01:01 UTC
> ps: please Lucas, assign to you all the bugs you are already working on (at
> least in the wiki), to avoid duplicating work. Thanks.

I had assigned my self to this topic in the wiki page. It's just that for some reason I haven't added this specifig bug report to the taslk list. :-)

Comment 11 Lucas Rocha 2007-02-26 22:57:24 UTC
Fixed in eog-ng branch. Closing as it's already fixed in trunk.

2007-02-26  Lucas Rocha  <lucasr@gnome.org>

        Messages for the most of common error: open a set of locations with no
        images, open a directory with no images, open a non-image file and
        open a corrupted/invalid image. Fixes bugs #326199, #399988, and #316175.

        * src/eog-list-store.c (eog_list_store_add_uris,
        eog_list_store_class_init, eog_list_store_init): add initial image
        even if it doesn't pass the mimetype tests. GObject love and code
        cleanups.
        * src/eog-application.c: comment unused function to fix build warning.
        * src/eog-window.c (eog_job_load_cb, eog_window_open_uri_list,
        eog_window_dispose, eog_job_model_cb): set window title with image
        caption even in image loading error cases. Set error message area when
        no images are found in given locations. 
        * src/eog-error-message-area.[ch]
        (eog_no_images_error_message_area_new): new message area for errors
        when no images are found in given locations.