# HG changeset patch # User Colin Clark # Date 1538666185 -3600 # Node ID c8cc3884bc8d5bbe41da2914fa11374e6d342218 # Parent bb44bd76f857002a398c85d6880dca0102ee6812 Ref #160: Replace print dialog by standard GTK dialog https://github.com/BestImageViewer/geeqie/issues/160 Rotate to exif orientation diff -r bb44bd76f857 -r c8cc3884bc8d src/print.c --- a/src/print.c Tue Oct 02 13:01:06 2018 +0100 +++ b/src/print.c Thu Oct 04 16:16:25 2018 +0100 @@ -21,8 +21,10 @@ #include "main.h" #include "print.h" +#include "exif.h" #include "filedata.h" #include "image-load.h" +#include "pixbuf_util.h" #include "ui_misc.h" #include "ui_fileops.h" @@ -527,6 +529,7 @@ gdouble height_offset; GdkPixbuf *pixbuf; GdkPixbuf *pixbuf_scaled; + GdkPixbuf *rotated = NULL; PangoLayout *layout_image = NULL; PangoLayout *layout_page = NULL; PangoFontDescription *desc; @@ -543,12 +546,18 @@ GtkTextIter start, end; gchar *tmp; + fd = g_list_nth_data(pw->source_selection, page_nr); + pixbuf = g_list_nth_data(pw->print_pixbuf_queue, page_nr); + if (fd->exif_orientation != EXIF_ORIENTATION_TOP_LEFT) + { + rotated = pixbuf_apply_orientation(pixbuf, fd->exif_orientation); + pixbuf = rotated; + } + pixbuf_image_width = gdk_pixbuf_get_width(pixbuf); pixbuf_image_height = gdk_pixbuf_get_height(pixbuf); - fd = g_list_nth_data(pw->source_selection, page_nr); - if (options->printer.show_image_text) { if (pw->text_fields & TEXT_INFO_FILENAME) @@ -749,6 +758,7 @@ } g_object_unref(pixbuf_scaled); + if (rotated) g_object_unref(rotated); return; }