summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-17 21:18:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-17 21:18:27 +0200
commitcb74e5dc838b12c43510410aa81634a855fb5fd6 (patch)
treef274db29e9ee100663d5e662e772c4c0fe74bff5 /src
parent9803fc41e8e6a820634f41d2196bdced7cbbc99f (diff)
parent1e4a78c872cec48a839fbd55e430cac40e16dd9b (diff)
Merge branch 'Ferada-complete-exif-rotations'
Diffstat (limited to 'src')
-rw-r--r--src/gib_imlib.c12
-rw-r--r--src/gib_imlib.h2
-rw-r--r--src/imlib.c14
3 files changed, 27 insertions, 1 deletions
diff --git a/src/gib_imlib.c b/src/gib_imlib.c
index 8f401aa..7858cb7 100644
--- a/src/gib_imlib.c
+++ b/src/gib_imlib.c
@@ -717,3 +717,15 @@ void gib_imlib_image_orientate(Imlib_Image im, int orientation)
imlib_context_set_image(im);
imlib_image_orientate(orientation);
}
+
+void gib_imlib_image_flip_horizontal(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_horizontal();
+}
+
+void gib_imlib_image_flip_vertical(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_vertical();
+}
diff --git a/src/gib_imlib.h b/src/gib_imlib.h
index 6a16a0c..07daabe 100644
--- a/src/gib_imlib.h
+++ b/src/gib_imlib.h
@@ -181,6 +181,8 @@ void gib_imlib_parse_color(char *col, int *r, int *g, int *b, int *a);
void gib_imlib_parse_fontpath(char *path);
Imlib_Font gib_imlib_load_font(char *name);
void gib_imlib_image_orientate(Imlib_Image im, int orientation);
+void gib_imlib_image_flip_horizontal(Imlib_Image im);
+void gib_imlib_image_flip_vertical(Imlib_Image im);
#ifdef __cplusplus
}
diff --git a/src/imlib.c b/src/imlib.c
index f41cdcd..18547a9 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -294,10 +294,22 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
}
file->ed = exifData;
- if (orientation == 3)
+ if (orientation == 2)
+ gib_imlib_image_flip_horizontal(*im);
+ else if (orientation == 3)
gib_imlib_image_orientate(*im, 2);
+ else if (orientation == 4)
+ gib_imlib_image_flip_vertical(*im);
+ else if (orientation == 5) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_vertical(*im);
+ }
else if (orientation == 6)
gib_imlib_image_orientate(*im, 1);
+ else if (orientation == 7) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_horizontal(*im);
+ }
else if (orientation == 8)
gib_imlib_image_orientate(*im, 3);
#endif