In the imageto...() filter functions with print-scaling=auto the image
size was not compared correctly with the page size to switch between
fit-to-page for large sizes and no scaling for small sizes. The image
size in pixels was compared with the page size in PostScript points
(1/72 inch).
This commit fixes the comparisons.
pw = ph;
ph = tmp;
}
- if(w>pw||h>ph) {
+ if (w * 72.0 / doc.img->xppi > pw || h * 72.0 / doc.img->yppi > ph)
document_large = 1;
- }
if((val = cupsGetOption("print-scaling",num_options,options)) != NULL) {
if(!strcasecmp(val,"auto")) {
pw = ph;
ph = tmp;
}
- if (w > pw || h > ph)
+ if (w * 72.0 / img->xppi > pw || h * 72.0 / img->yppi > ph)
document_large = 1;
if ((val = cupsGetOption("print-scaling", num_options, options)) != NULL)
pw = ph;
ph = tmp;
}
- if(w>pw||h>ph)
- {
+ if (w * 72.0 / img->xppi > pw || h * 72.0 / img->yppi > ph)
document_large = 1;
- }
if((val = cupsGetOption("print-scaling",num_options,options)) != NULL)
{