Skip to content

Commit df5454e

Browse files
committed
Add support for RAW digicam input, requires custom libvips+libraw
1 parent 32cf6be commit df5454e

File tree

6 files changed

+10
-3
lines changed

6 files changed

+10
-3
lines changed

docs/src/content/docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Requires libvips v8.17.0
1818

1919
* Expose `keepDuplicateFrames` GIF output parameter.
2020

21+
* Add support for RAW digital camera image input. Requires libvips compiled with libraw support.
22+
2123
* Add `pageHeight` option to `create` and `raw` input for animated images.
2224
[#3236](https://github.com/lovell/sharp/issues/3236)
2325

lib/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ declare namespace sharp {
18901890

18911891
interface FormatEnum {
18921892
avif: AvailableFormatInfo;
1893+
dcraw: AvailableFormatInfo;
18931894
dz: AvailableFormatInfo;
18941895
exr: AvailableFormatInfo;
18951896
fits: AvailableFormatInfo;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@
179179
"icc": "^3.0.0",
180180
"jsdoc-to-markdown": "^9.1.1",
181181
"license-checker": "^25.0.1",
182-
"mocha": "^11.7.0",
182+
"mocha": "^11.7.1",
183183
"node-addon-api": "^8.4.0",
184184
"node-gyp": "^11.2.0",
185185
"nyc": "^17.1.0",
186186
"semistandard": "^17.0.0",
187-
"tar-fs": "^3.0.10",
187+
"tar-fs": "^3.1.0",
188188
"tsd": "^0.32.0"
189189
},
190190
"license": "Apache-2.0",

src/common.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ namespace sharp {
284284
case ImageType::EXR: id = "exr"; break;
285285
case ImageType::JXL: id = "jxl"; break;
286286
case ImageType::RAD: id = "rad"; break;
287+
case ImageType::DCRAW: id = "dcraw"; break;
287288
case ImageType::VIPS: id = "vips"; break;
288289
case ImageType::RAW: id = "raw"; break;
289290
case ImageType::UNKNOWN: id = "unknown"; break;
@@ -332,6 +333,8 @@ namespace sharp {
332333
{ "VipsForeignLoadJxlBuffer", ImageType::JXL },
333334
{ "VipsForeignLoadRadFile", ImageType::RAD },
334335
{ "VipsForeignLoadRadBuffer", ImageType::RAD },
336+
{ "VipsForeignLoadDcRawFile", ImageType::DCRAW },
337+
{ "VipsForeignLoadDcRawBuffer", ImageType::DCRAW },
335338
{ "VipsForeignLoadVips", ImageType::VIPS },
336339
{ "VipsForeignLoadVipsFile", ImageType::VIPS },
337340
{ "VipsForeignLoadRaw", ImageType::RAW }

src/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ namespace sharp {
169169
EXR,
170170
JXL,
171171
RAD,
172+
DCRAW,
172173
VIPS,
173174
RAW,
174175
UNKNOWN,

src/utilities.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Napi::Value format(const Napi::CallbackInfo& info) {
119119
Napi::Object format = Napi::Object::New(env);
120120
for (std::string const f : {
121121
"jpeg", "png", "webp", "tiff", "magick", "openslide", "dz",
122-
"ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl", "rad"
122+
"ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl", "rad", "dcraw"
123123
}) {
124124
// Input
125125
const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str());

0 commit comments

Comments
 (0)