Skip to content

Commit

Permalink
imagetoraster: Rotate image to fit output page best.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkamppeter committed Aug 25, 2019
1 parent 106d3d9 commit 41e5626
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ NEWS - OpenPrinting CUPS Filters v1.25.3 - 2019-08-21

CHANGES IN V1.25.4

- imagetoraster: Rotate image to fit output page best (Issue
#145).
- imagetoraster: Do not try to call imagetops and pstoraster
any more but imagetopdf and pdftoraster instead, as the
former filters do not exist any more.
Expand Down
4 changes: 2 additions & 2 deletions filter/imagetoraster.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ main(int argc, /* I - Number of command-line arguments */
}
if(tempOrientation==0)
{
if(min(pw,w)*min(ph,h)<min(pw,h)*min(ph,w))
if(((pw > ph) && (w < h)) || ((pw < ph) && (w > h)))
{
tempOrientation = 4;
}
Expand Down Expand Up @@ -825,7 +825,7 @@ main(int argc, /* I - Number of command-line arguments */
}
if(tempOrientation==0)
{
if(min(pw,w)*min(ph,h)<min(pw,h)*min(ph,w))
if(((pw > ph) && (w < h)) || ((pw < ph) && (w > h)))
{
int temp = pw;
pw = ph;
Expand Down

0 comments on commit 41e5626

Please sign in to comment.