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 655889 - image variable is not updated correctly
image variable is not updated correctly
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
unspecified
Other Linux
: Normal normal
: GNOME3.2
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-03 09:42 UTC by Fabian Sturm
Modified: 2011-08-09 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fabian Sturm 2011-08-03 09:42:50 UTC
Hello!

I think there is another bug in the eog image handling.
Whenever a selection changes and a new image is displayed, the current image pointer should be updated. Right now this only happens in the "eog_job_load_cb" but I think it also has to happen here:


handle_image_selection_changed_cb, around line 1791:

	if (eog_image_has_data (image, EOG_IMAGE_DATA_ALL)) {
		eog_window_display_image (window, image);
		return;
	}

should be

	if (eog_image_has_data (image, EOG_IMAGE_DATA_ALL)) {
		priv->image = image;
		eog_window_display_image (window, image);
		return;
	}

It is not yet a problem, since the scrollview alwas discards the image pixbuf and therefore the image is never displayed through this codepath but always through the eog_job_load_cb (has_data will always return false on the first call).

Sincerely,
Fabian
Comment 1 Felix Riemann 2011-08-04 17:47:57 UTC
(In reply to comment #0)
> It is not yet a problem, since the scrollview alwas discards the image pixbuf
> and therefore the image is never displayed through this codepath but always
> through the eog_job_load_cb (has_data will always return false on the first
> call).

Well, as the EOG_IMAGE_DATA_ALL could be reduced to EOG_IMAGE_DATA_IMAGE in this case this could become an issue.

Maybe it makes sense to move the update of the image pointer into eog_window_display_image() or even handle it as a (public readonly) property.
Comment 2 Felix Riemann 2011-08-09 20:04:00 UTC
Turns out it could actually cause quirks when the were additional references on the image data (e.g. by plugins). Expanded the fix to also release the ref on the previous image handle.

commit a3b769506abbbf7b24547b95c9c99349e99d44c0
Author: Felix Riemann <>
Date:   Tue Aug 9 21:57:35 2011 +0200

    Update EogWindow's image handle when selecting already loaded images
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655889

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.