sharp 0.30.7 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/binding.gyp +4 -3
- package/lib/composite.js +14 -0
- package/lib/constructor.js +41 -4
- package/lib/input.js +92 -0
- package/lib/operation.js +57 -12
- package/lib/output.js +87 -23
- package/lib/resize.js +89 -12
- package/lib/utility.js +4 -0
- package/package.json +23 -21
- package/src/common.cc +90 -43
- package/src/common.h +32 -14
- package/src/libvips/cplusplus/VConnection.cpp +0 -1
- package/src/libvips/cplusplus/VError.cpp +0 -1
- package/src/libvips/cplusplus/VImage.cpp +27 -2
- package/src/libvips/cplusplus/VInterpolate.cpp +0 -1
- package/src/libvips/cplusplus/VRegion.cpp +27 -0
- package/src/libvips/cplusplus/vips-operators.cpp +16 -1
- package/src/operations.cc +69 -25
- package/src/operations.h +7 -2
- package/src/pipeline.cc +156 -160
- package/src/pipeline.h +18 -5
- package/src/sharp.cc +0 -1
- package/src/utilities.cc +13 -2
package/src/sharp.cc
CHANGED
package/src/utilities.cc
CHANGED
|
@@ -118,14 +118,25 @@ Napi::Value format(const Napi::CallbackInfo& info) {
|
|
|
118
118
|
"ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k"
|
|
119
119
|
}) {
|
|
120
120
|
// Input
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str());
|
|
122
|
+
Napi::Boolean hasInputFile = Napi::Boolean::New(env, oc);
|
|
123
123
|
Napi::Boolean hasInputBuffer =
|
|
124
124
|
Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "load_buffer").c_str()));
|
|
125
125
|
Napi::Object input = Napi::Object::New(env);
|
|
126
126
|
input.Set("file", hasInputFile);
|
|
127
127
|
input.Set("buffer", hasInputBuffer);
|
|
128
128
|
input.Set("stream", hasInputBuffer);
|
|
129
|
+
if (hasInputFile) {
|
|
130
|
+
const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
|
|
131
|
+
if (fc->suffs) {
|
|
132
|
+
Napi::Array fileSuffix = Napi::Array::New(env);
|
|
133
|
+
const char **suffix = fc->suffs;
|
|
134
|
+
for (int i = 0; *suffix; i++, suffix++) {
|
|
135
|
+
fileSuffix.Set(i, Napi::String::New(env, *suffix));
|
|
136
|
+
}
|
|
137
|
+
input.Set("fileSuffix", fileSuffix);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
129
140
|
// Output
|
|
130
141
|
Napi::Boolean hasOutputFile =
|
|
131
142
|
Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "save").c_str()));
|