From 24886f91b1e55ab2f79327a00bb53729ddfde7b9 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Wed, 24 Aug 2022 13:58:27 -0400 Subject: [PATCH] plug-ins: fix #8508 Print exporting to PSD seems to export as cm ... and import as inches When GIMP's display unit was mm, our PSD export converted the X and Y resolution as if a conversion from mm to inch was needed. However, PSD's resolution is always measured in pixels per inch, so a conversion is never necessary. Removing the conversion, resolves the issue. --- plug-ins/file-psd/psd-save.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c index 5767384512..99ae48ca17 100644 --- a/plug-ins/file-psd/psd-save.c +++ b/plug-ins/file-psd/psd-save.c @@ -834,11 +834,6 @@ save_resources (GOutputStream *output, if (g_unit == GIMP_UNIT_MM) { - gdouble factor = gimp_unit_get_factor (g_unit) / 10.0; - - xres /= factor; - yres /= factor; - psd_unit = PSD_UNIT_CM; } else @@ -846,6 +841,8 @@ save_resources (GOutputStream *output, psd_unit = PSD_UNIT_INCH; } + /* Don't convert resolution based on g_unit which is a display unit. + * PSD resolution is always in pixels/inch. */ xres_fix = xres * 65536.0 + .5; /* Convert to 16.16 fixed point */ yres_fix = yres * 65536.0 + .5; /* Convert to 16.16 fixed point */