mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
check input files with vips foreign lib
This commit is contained in:
parent
b6dc179551
commit
9bd335079f
@ -98,21 +98,21 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
(baton->err).append("Unsupported input buffer");
|
(baton->err).append("Unsupported input buffer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (is_jpeg(baton->file_in)) {
|
} else if (vips_foreign_is_a("jpegload", baton->file_in.c_str())) {
|
||||||
if (vips_jpegload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
if (vips_jpegload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||||
return resize_error(baton, in);
|
return resize_error(baton, in);
|
||||||
}
|
}
|
||||||
} else if (is_png(baton->file_in)) {
|
} else if (vips_foreign_is_a("pngload", baton->file_in.c_str())) {
|
||||||
inputImageType = PNG;
|
inputImageType = PNG;
|
||||||
if (vips_pngload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
if (vips_pngload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||||
return resize_error(baton, in);
|
return resize_error(baton, in);
|
||||||
}
|
}
|
||||||
} else if (is_webp(baton->file_in)) {
|
} else if (vips_foreign_is_a("webpload", baton->file_in.c_str())) {
|
||||||
inputImageType = WEBP;
|
inputImageType = WEBP;
|
||||||
if (vips_webpload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
if (vips_webpload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||||
return resize_error(baton, in);
|
return resize_error(baton, in);
|
||||||
}
|
}
|
||||||
} else if (is_tiff(baton->file_in)) {
|
} else if (vips_foreign_is_a("tiffload", baton->file_in.c_str())) {
|
||||||
inputImageType = TIFF;
|
inputImageType = TIFF;
|
||||||
if (vips_tiffload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
if (vips_tiffload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||||
return resize_error(baton, in);
|
return resize_error(baton, in);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user