summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eom-print.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/eom-print.c b/src/eom-print.c
index 54db68e..4d20a29 100644
--- a/src/eom-print.c
+++ b/src/eom-print.c
@@ -317,6 +317,7 @@ eom_print_operation_new (EomImage *image,
{
GtkPrintOperation *print;
EomPrintData *data;
+ gint width, height;
eom_debug (DEBUG_PRINTING);
@@ -330,6 +331,19 @@ eom_print_operation_new (EomImage *image,
data->image = g_object_ref (image);
data->unit = GTK_UNIT_INCH;
+ eom_image_get_size (image, &width, &height);
+
+ if (page_setup == NULL)
+ page_setup = gtk_page_setup_new ();
+
+ if (height >= width) {
+ gtk_page_setup_set_orientation (page_setup,
+ GTK_PAGE_ORIENTATION_PORTRAIT);
+ } else {
+ gtk_page_setup_set_orientation (page_setup,
+ GTK_PAGE_ORIENTATION_LANDSCAPE);
+ }
+
gtk_print_operation_set_print_settings (print, print_settings);
gtk_print_operation_set_default_page_setup (print,
page_setup);