forked from old/legacy-imlib2
TIFF loader: Minor speedup
This commit is contained in:
parent
b059049034
commit
4ec88a0dda
|
@ -257,17 +257,14 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
rc = LOAD_FAIL;
|
rc = LOAD_FAIL;
|
||||||
rgba_image.image = NULL;
|
rgba_image.image = NULL;
|
||||||
|
|
||||||
if (fread(&magic_number, sizeof(uint16), 1, f) != 1)
|
fd = fileno(f);
|
||||||
|
if (read(fd, &magic_number, sizeof(uint16)) != sizeof(uint16))
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
/* Apparently rewind(f) isn't sufficient */
|
|
||||||
fseek(f, 0, SEEK_SET);
|
|
||||||
|
|
||||||
if ((magic_number != TIFF_BIGENDIAN) /* Checks if actually tiff file */
|
if ((magic_number != TIFF_BIGENDIAN) /* Checks if actually tiff file */
|
||||||
&& (magic_number != TIFF_LITTLEENDIAN))
|
&& (magic_number != TIFF_LITTLEENDIAN))
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
fd = fileno(f);
|
|
||||||
fd = dup(fd);
|
fd = dup(fd);
|
||||||
lseek(fd, 0, SEEK_SET);
|
lseek(fd, 0, SEEK_SET);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
Loading…
Reference in New Issue