diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-04-09 23:46:17 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-04-09 23:46:17 +0200 |
| commit | dac6950d9e556d5521ad7913d27a6cf83e2a90a1 (patch) | |
| tree | bb6a65d973337a0504117888d5534967cc51f479 /src/blind-crop.c | |
| parent | Clean up (diff) | |
| download | blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.gz blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.bz2 blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.xz | |
Clean up
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-crop.c')
| -rw-r--r-- | src/blind-crop.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/blind-crop.c b/src/blind-crop.c index fa76762..1ad9a19 100644 --- a/src/blind-crop.c +++ b/src/blind-crop.c @@ -41,9 +41,7 @@ main(int argc, char *argv[]) left = etozu_arg("the left position", argv[2], 0, SIZE_MAX); top = etozu_arg("the top position", argv[3], 0, SIZE_MAX); - stream.file = "<stdin>"; - stream.fd = STDIN_FILENO; - einit_stream(&stream); + eopen_stream(&stream, NULL); if (left > SIZE_MAX - width || left + width > stream.width || top > SIZE_MAX - height || top + height > stream.height) eprintf("crop area extends beyond original image\n"); @@ -72,10 +70,8 @@ main(int argc, char *argv[]) off = (orown - left % orown) % orown; yoff = (height - top % height) % height; } - bottom_start = top + height; - bottom = stream.height - bottom_start; - right_start = left + orown; - right = irown - right_start; + bottom = stream.height - (bottom_start = top + height); + right = irown - (right_start = left + orown); while (eread_frame(&stream, buf, n)) { if (tile) { |
