[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix stretching/zooming of images with orientation metadata (Bug #15292)
noreply at xfce.org
noreply at xfce.org
Wed Apr 17 02:34:45 CEST 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfdesktop.
commit 063c4e134dd354a61fb38f3bb1ce8468c7c31ff6
Author: Andre Miranda <andreldm at xfce.org>
Date: Tue Apr 16 21:32:58 2019 -0300
Fix stretching/zooming of images with orientation metadata (Bug #15292)
---
src/xfce-backdrop.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 4bc9ab8..5227a60 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -1858,6 +1858,9 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
return;
}
+ xscale = (gdouble)w / iw;
+ yscale = (gdouble)h / ih;
+
switch(istyle) {
case XFCE_BACKDROP_IMAGE_NONE:
/* do nothing */
@@ -1903,12 +1906,13 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
case XFCE_BACKDROP_IMAGE_STRETCHED:
gdk_pixbuf_composite(image, final_image, 0, 0, w, h,
- 0, 0, 1, 1, interp, 255);
+ 0, 0,
+ rotated ? xscale : 1,
+ rotated ? yscale : 1,
+ interp, 255);
break;
case XFCE_BACKDROP_IMAGE_SCALED:
- xscale = (gdouble)w / iw;
- yscale = (gdouble)h / ih;
if(xscale < yscale) {
yscale = xscale;
xo = 0;
@@ -1930,8 +1934,6 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
case XFCE_BACKDROP_IMAGE_ZOOMED:
case XFCE_BACKDROP_IMAGE_SPANNING_SCREENS:
- xscale = (gdouble)w / iw;
- yscale = (gdouble)h / ih;
if(xscale < yscale) {
xscale = yscale;
xo = (w - (iw * xscale)) * 0.5;
@@ -1943,7 +1945,10 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
}
gdk_pixbuf_composite(image, final_image, 0, 0,
- w, h, xo, yo, 1, 1, interp, 255);
+ w, h, xo, yo,
+ rotated ? xscale : 1,
+ rotated ? yscale : 1,
+ interp, 255);
break;
default:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list