Blame SOURCES/ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch

937b19
diff -x .git -Napur ghostscript-9.27.old/contrib/japanese/gdevespg.c ghostscript-9.27.new/contrib/japanese/gdevespg.c
937b19
--- ghostscript-9.27.old/contrib/japanese/gdevespg.c	2019-04-04 00:43:14.000000000 -0700
937b19
+++ ghostscript-9.27.new/contrib/japanese/gdevespg.c	2023-01-24 11:25:32.588189093 -0800
937b19
@@ -273,6 +273,9 @@
937b19
     int width, height, w, h, wp, hp, bLandscape;
937b19
     EpagPaperTable *pt;
937b19
 
937b19
+    /* Page size match tolerance in points */
937b19
+    #define TOL 5
937b19
+
937b19
     width = (int)pdev->MediaSize[0];
937b19
     height = (int)pdev->MediaSize[1];
937b19
 
937b19
@@ -291,7 +294,7 @@
937b19
     }
937b19
 
937b19
     for (pt = epagPaperTable; pt->escpage > 0; pt++)
937b19
-        if (pt->width == w && pt->height == h)
937b19
+      if (abs(w - pt->width) <= TOL && abs(h - pt->height) <= TOL)
937b19
             break;
937b19
 
937b19
     gp_fprintf(fp, "%c%d", GS, pt->escpage);