mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 11:00:14 +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("buffer", hasInputBuffer);
|
||||||
input.Set("stream", hasInputBuffer);
|
input.Set("stream", hasInputBuffer);
|
||||||
if (hasInputFile) {
|
if (hasInputFile) {
|
||||||
Napi::Array fileSuffix = Napi::Array::New(env);
|
const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
|
||||||
const char **suffix = VIPS_FOREIGN_CLASS(oc)->suffs;
|
if (fc->suffs) {
|
||||||
for (int i = 0; *suffix; i++, suffix++) {
|
Napi::Array fileSuffix = Napi::Array::New(env);
|
||||||
fileSuffix.Set(i, Napi::String::New(env, *suffix));
|
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
|
// Output
|
||||||
Napi::Boolean hasOutputFile =
|
Napi::Boolean hasOutputFile =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user