diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-02-10 18:05:00 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-02-10 18:05:00 +0100 |
commit | f7eec706f7278299281abfa8354ecac7a10e767a (patch) | |
tree | 901d4657e1312ede812cd792ea0c42081d328b6c /src | |
parent | 73196195c2223f2d3f5afbfc4aeef8801122b45b (diff) | |
parent | 263c3dafed233ed2040f53f19f5d20809e9ef42d (diff) |
merge
Diffstat (limited to 'src')
-rw-r--r-- | src/PostscriptDSC.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/PostscriptDSC.cxx b/src/PostscriptDSC.cxx index 985722d..22cfe40 100644 --- a/src/PostscriptDSC.cxx +++ b/src/PostscriptDSC.cxx @@ -51,6 +51,7 @@ PostscriptDSC::parse(int fd) { int x, y, w, h; int p1, p2, ps; int i = 0; + int bb_read = 0; bb_x = 0; bb_y = 0; @@ -75,11 +76,13 @@ PostscriptDSC::parse(int fd) { } while (fgets(linebuf, sizeof(linebuf), fp) != NULL) { - if (sscanf(linebuf, "%%%%BoundingBox: %d %d %d %d", &x, &y, &w, &h) == 4) { + if (!bb_read && + sscanf(linebuf, "%%%%BoundingBox: %d %d %d %d", &x, &y, &w, &h) == 4) { bb_x = x; bb_y = y; bb_w = w; bb_h = h; + bb_read++; } else if (strncmp(linebuf, "%%EndSetup", strlen("%%EndSetup")) == 0) { setup_len = ftello(fp); } else if (sscanf(linebuf, "%%%%Pages: %d", &ps) == 1) { |