summaryrefslogtreecommitdiff
path: root/gs/Resource
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2014-02-10 08:34:54 +0000
committerKen Sharp <ken.sharp@artifex.com>2014-02-10 08:34:54 +0000
commitd59e1feb9545b399027907cb2d1a6855c524e0b4 (patch)
treec2c8a601921c6e54e1910ed5d57fd399e7c8e172 /gs/Resource
parentdc3770910997a17386c65eaa44e73cf7cf5e8339 (diff)
downloadghostpdl-d59e1feb9545b399027907cb2d1a6855c524e0b4.tar.gz
PS interpreter - Fix rotation problem with EPSFitPage
Bug #695016 "Gradient eps file to pdf" When fitting an EPS Bounding Box to a specified page size, the code looks at the width and height of both the page and the EPS file, to see if the EPS will fit 'better' by rotating it. In this particular case the page is square, but there was no special case for this, which mean that landscape pages wold be rotated twice, causing the content to disappear. This commit special cases square media sizes and does not attempt to rotate the EPS, no matter what its orientation, as there is clearly no point in doing so. This prevents the double rotation and resolves the problem. Tested with landscape, portrait and square media and EPS files, in all combinations. No differences expected
Diffstat (limited to 'gs/Resource')
-rw-r--r--gs/Resource/Init/gs_epsf.ps8
1 files changed, 6 insertions, 2 deletions
diff --git a/gs/Resource/Init/gs_epsf.ps b/gs/Resource/Init/gs_epsf.ps
index b61ce3438..b0072fb96 100644
--- a/gs/Resource/Init/gs_epsf.ps
+++ b/gs/Resource/Init/gs_epsf.ps
@@ -63,9 +63,13 @@
% translate to new origin at lower left of clippath
3 index 3 index translate
% Figure out if rotate is needed.
+ 1 index 4 index sub 1 index 4 index sub eq not {
1 index 4 index sub 1 index 4 index sub gt % bbox page-clipbox page-is-landscape
- 6 index 10 index sub 6 index 10 index sub gt % bbox page-clipbox page-is-landscape bbox-is-landscape
- xor 9 1 roll % compute need-rotate.
+ 6 index 9 index sub 6 index 9 index sub gt % bbox page-clipbox page-is-landscape bbox-is-landscape
+ xor}{
+ false
+ }ifelse
+ 9 1 roll % compute need-rotate.
% stack: rotate-needed bbox page-clipbox
% calculate scale to fit smaller of width or height
exch 4 -1 roll sub 3 1 roll exch sub