Seek over EXIF APP0 frame instead of reading and discarding it

This commit is contained in:
Bert Münnich 2013-10-05 17:37:00 +02:00
parent 5dea695c71
commit 1b089bc2fa
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
VERSION = git-20130907 VERSION = git-20131005
PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man

5
exif.c
View File

@ -79,9 +79,10 @@ int exif_orientation(const fileinfo_t *file)
goto abort; goto abort;
if (s_read(fd, file->name, data, 4) < 0) if (s_read(fd, file->name, data, 4) < 0)
goto abort; goto abort;
if (btous(data, order) == JPEG_MARKER_APP0){
if (btous(data, order) == JPEG_MARKER_APP0) {
len = btous(data + 2, order); len = btous(data + 2, order);
if (s_read(fd, file->name, data, len - 2) < 0) if (lseek(fd, len - 2, SEEK_CUR) == (off_t) -1)
goto abort; goto abort;
if (s_read(fd, file->name, data, 4) < 0) if (s_read(fd, file->name, data, 4) < 0)
goto abort; goto abort;