Krolyxon
Commit 1b089bc

Branches

Refs →

nsxiv1b089bc

Seek over EXIF APP0 frame instead of reading and discarding it

Author
Bert Münnich
Date
2013-10-05 17:37 +0200
Parent
5dea695
Commit
1b089bc2fa36fdbd69af25a15ec5ee3e8963b80d

+4 −3

2 files changed

  1. M Makefile +1 −1
  2. M exif.c +3 −2
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20130907
1+VERSION = git-20131005
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M exif.c View
@@ -79,9 +79,10 @@ int exif_orientation(const fileinfo_t *file)
7979 goto abort;
8080 if (s_read(fd, file->name, data, 4) < 0)
8181 goto abort;
82− if (btous(data, order) == JPEG_MARKER_APP0){
82+
83+ if (btous(data, order) == JPEG_MARKER_APP0) {
8384 len = btous(data + 2, order);
84− if (s_read(fd, file->name, data, len - 2) < 0)
85+ if (lseek(fd, len - 2, SEEK_CUR) == (off_t) -1)
8586 goto abort;
8687 if (s_read(fd, file->name, data, 4) < 0)
8788 goto abort;