SHA256
1
0
forked from pool/xfig
xfig/xfig.3.2.5b-mediaboxrealnb.dif

26 lines
882 B
Plaintext
Raw Normal View History

--- f_readeps.c
+++ f_readeps.c 2013-02-07 14:10:06.681492792 +0000
@@ -79,15 +79,21 @@ read_epsf_pdf(FILE *file, int filetype,
if (pdf_flag) {
if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */
char *c;
+ float rllx, rlly, rurx, rury;
c = strchr(buf, '[') + 1;
- if (c && sscanf(c, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) {
+ if (c && sscanf(c, "%d %d %d %d", "%f %f %f %f", &rllx, &rlly, &rurx, &rury) < 4) {
llx = lly = 0;
urx = paper_sizes[0].width * 72 / PIX_PER_INCH;
ury = paper_sizes[0].height * 72 / PIX_PER_INCH;
file_msg("Bad MediaBox in header, assuming %s size",
appres.INCHES ? "Letter" : "A4");
app_flush();
+ } else {
+ llx = round(rllx);
+ lly = round(rlly);
+ urx = round(rurx);
+ ury = round(rury);
}
}
/* look for bounding box */