[gimp/gimp-2-6] Bug 569661 – Import from PDF throws errors when entering resolution in pixels per millimetre



commit d07fcc010275b9234c58fd76b75b0665e782e67a
Author: Massimo Valentini <sixtysix inwind it>
Date:   Tue Jul 7 17:09:21 2009 +0200

    Bug 569661 â?? Import from PDF throws errors when entering resolution in pixels per millimetre
    
    Fix calculation of dpi value.
    (cherry picked from commit a7bca9407d7dec994cbb116e32e84589d34840a5)

 plug-ins/common/file-pdf.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-pdf.c b/plug-ins/common/file-pdf.c
index 4a2338a..6b733c9 100644
--- a/plug-ins/common/file-pdf.c
+++ b/plug-ins/common/file-pdf.c
@@ -1279,7 +1279,8 @@ gimp_resolution_entry_get_x_in_dpi (GimpResolutionEntry *gre)
 {
   g_return_val_if_fail (GIMP_IS_RESOLUTION_ENTRY (gre), 0);
 
-  return gre->x.value / gimp_unit_get_factor (gre->unit);
+  /* dots_in_one_unit * units_in_one_inch -> dpi */
+  return gre->x.value * gimp_unit_get_factor (gre->unit);
 }
 
 /**
@@ -1293,7 +1294,7 @@ gimp_resolution_entry_get_y_in_dpi (GimpResolutionEntry *gre)
 {
   g_return_val_if_fail (GIMP_IS_RESOLUTION_ENTRY (gre), 0);
 
-  return gre->y.value / gimp_unit_get_factor (gre->unit);
+  return gre->y.value * gimp_unit_get_factor (gre->unit);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]