[gthumb] do not update the quality of scalable images and animations
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] do not update the quality of scalable images and animations
- Date: Sat, 9 Nov 2013 20:00:02 +0000 (UTC)
commit 434077421ad7456f3057fccbbaa9de10df8248d4
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Oct 6 14:23:00 2013 +0200
do not update the quality of scalable images and animations
extensions/image_viewer/gth-image-viewer-page.c | 6 ++++++
gthumb/gth-image-preloader.c | 3 +++
gthumb/gth-image-viewer.c | 4 ++--
gthumb/gth-image.c | 2 +-
gthumb/gth-image.h | 2 +-
5 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 8f64587..f9bff7c 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -358,9 +358,15 @@ update_quality_cb (gpointer user_data)
static void
update_image_quality_if_required (GthImageViewerPage *self)
{
+ GthImage *image;
+
if (self->priv->loading_image)
return;
+ image = gth_image_viewer_get_image (GTH_IMAGE_VIEWER (self->priv->viewer));
+ if ((image != NULL) && (gth_image_get_is_zoomable (image) || gth_image_get_is_animation (image)))
+ return;
+
if (self->priv->update_quality_event != 0) {
g_source_remove (self->priv->update_quality_event);
self->priv->update_quality_event = 0;
diff --git a/gthumb/gth-image-preloader.c b/gthumb/gth-image-preloader.c
index 07cbf86..9691d98 100644
--- a/gthumb/gth-image-preloader.c
+++ b/gthumb/gth-image-preloader.c
@@ -592,6 +592,9 @@ image_loader_ready_cb (GObject *source_object,
if ((request->requested_size > 0) && loaded_original)
load_data->resize_to_requested_size = TRUE;
+ if (gth_image_get_is_zoomable (image) || gth_image_get_is_animation (image))
+ load_data->resize_to_requested_size = FALSE;
+
if (load_data->resize_to_requested_size)
_gth_image_preloader_resize_at_requested_size (self, request, cache_data->image);
else
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index 87a3813..84b1343 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -1757,7 +1757,7 @@ gth_image_viewer_set_better_quality (GthImageViewer *self,
int original_width,
int original_height)
{
- if (gth_image_is_animation (image)) {
+ if (gth_image_get_is_animation (image)) {
GdkPixbufAnimation *animation;
animation = gth_image_get_pixbuf_animation (image);
@@ -1813,7 +1813,7 @@ gth_image_viewer_set_image (GthImageViewer *self,
if (self->priv->image != image)
_g_clear_object (&self->priv->image);
- if (gth_image_is_animation (image)) {
+ if (gth_image_get_is_animation (image)) {
GdkPixbufAnimation *animation;
animation = gth_image_get_pixbuf_animation (image);
diff --git a/gthumb/gth-image.c b/gthumb/gth-image.c
index 81f84cf..fd5627f 100644
--- a/gthumb/gth-image.c
+++ b/gthumb/gth-image.c
@@ -343,7 +343,7 @@ gth_image_get_pixbuf_animation (GthImage *image)
gboolean
-gth_image_is_animation (GthImage *image)
+gth_image_get_is_animation (GthImage *image)
{
return ((image->priv->format == GTH_IMAGE_FORMAT_GDK_PIXBUF_ANIMATION)
&& (! gdk_pixbuf_animation_is_static_image (image->priv->data.pixbuf_animation)));
diff --git a/gthumb/gth-image.h b/gthumb/gth-image.h
index 49e38d9..5800506 100644
--- a/gthumb/gth-image.h
+++ b/gthumb/gth-image.h
@@ -96,7 +96,7 @@ GdkPixbuf * gth_image_get_pixbuf (GthImage
void gth_image_set_pixbuf_animation (GthImage *image,
GdkPixbufAnimation *value);
GdkPixbufAnimation * gth_image_get_pixbuf_animation (GthImage *image);
-gboolean gth_image_is_animation (GthImage *image);
+gboolean gth_image_get_is_animation (GthImage *image);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]