mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
add libmagick load support
This commit is contained in:
@@ -33,7 +33,8 @@ typedef enum {
|
||||
JPEG,
|
||||
PNG,
|
||||
WEBP,
|
||||
TIFF
|
||||
TIFF,
|
||||
MAGICK
|
||||
} ImageType;
|
||||
|
||||
unsigned char MARKER_JPEG[] = {0xff, 0xd8};
|
||||
@@ -117,6 +118,11 @@ class ResizeWorker : public NanAsyncWorker {
|
||||
if (vips_tiffload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||
return resize_error(baton, in);
|
||||
}
|
||||
} else if(vips_foreign_is_a("magickload", (baton->file_in).c_str())) {
|
||||
inputImageType = MAGICK;
|
||||
if (vips_magickload((baton->file_in).c_str(), &in, "access", baton->access_method, NULL)) {
|
||||
return resize_error(baton, in);
|
||||
}
|
||||
} else {
|
||||
resize_error(baton, in);
|
||||
(baton->err).append("Unsupported input file " + baton->file_in);
|
||||
|
||||
Reference in New Issue
Block a user