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



commit c79af13a90ca6030ec95f233d8bfd1b55e34262a
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.

 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 36d13e8..36fa328 100644
--- a/plug-ins/common/file-pdf.c
+++ b/plug-ins/common/file-pdf.c
@@ -1288,7 +1288,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);
 }
 
 /**
@@ -1302,7 +1303,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]