mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 02:50:15 +02:00
Ensure fileSuffix supports suffix-less loaders
This commit is contained in:
parent
e4160c684d
commit
1b84ccbbe9
@ -127,12 +127,15 @@ Napi::Value format(const Napi::CallbackInfo& info) {
|
||||
input.Set("buffer", hasInputBuffer);
|
||||
input.Set("stream", hasInputBuffer);
|
||||
if (hasInputFile) {
|
||||
Napi::Array fileSuffix = Napi::Array::New(env);
|
||||
const char **suffix = VIPS_FOREIGN_CLASS(oc)->suffs;
|
||||
for (int i = 0; *suffix; i++, suffix++) {
|
||||
fileSuffix.Set(i, Napi::String::New(env, *suffix));
|
||||
const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
|
||||
if (fc->suffs) {
|
||||
Napi::Array fileSuffix = Napi::Array::New(env);
|
||||
const char **suffix = fc->suffs;
|
||||
for (int i = 0; *suffix; i++, suffix++) {
|
||||
fileSuffix.Set(i, Napi::String::New(env, *suffix));
|
||||
}
|
||||
input.Set("fileSuffix", fileSuffix);
|
||||
}
|
||||
input.Set("fileSuffix", fileSuffix);
|
||||
}
|
||||
// Output
|
||||
Napi::Boolean hasOutputFile =
|
||||
|
Loading…
x
Reference in New Issue
Block a user