mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-28 14:38:21 +01:00
Merge "cwebp/tiff: use the first image directory"
This commit is contained in:
commit
a1b5a9a3e0
@ -26,18 +26,17 @@ int ReadTIFF(const char* const filename,
|
|||||||
uint32 width, height;
|
uint32 width, height;
|
||||||
uint32* raster;
|
uint32* raster;
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
int dircount = 1;
|
tdir_t dircount;
|
||||||
|
|
||||||
if (tif == NULL) {
|
if (tif == NULL) {
|
||||||
fprintf(stderr, "Error! Cannot open TIFF file '%s'\n", filename);
|
fprintf(stderr, "Error! Cannot open TIFF file '%s'\n", filename);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (TIFFReadDirectory(tif)) ++dircount;
|
dircount = TIFFNumberOfDirectories(tif);
|
||||||
|
|
||||||
if (dircount > 1) {
|
if (dircount > 1) {
|
||||||
fprintf(stderr, "Warning: multi-directory TIFF files are not supported.\n"
|
fprintf(stderr, "Warning: multi-directory TIFF files are not supported.\n"
|
||||||
"Only the first will be used, %d will be ignored.\n",
|
"Only the first will be used, %hu will be ignored.\n",
|
||||||
dircount - 1);
|
dircount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user