Add support for RGBE Radiance input, requires global libvips #4316

This commit is contained in:
florentzabera 2025-01-21 09:12:39 +01:00 committed by Lovell Fuller
parent ae5ba702a4
commit 67ff930535
5 changed files with 12 additions and 1 deletions

View File

@ -311,3 +311,6 @@ GitHub: https://github.com/calebmer
Name: Don Denton Name: Don Denton
GitHub: https://github.com/happycollision GitHub: https://github.com/happycollision
Name: Florent Zabera
GitHub: https://github.com/florentzabera

View File

@ -34,6 +34,10 @@ Requires libvips v8.16.0
[#4207](https://github.com/lovell/sharp/pull/4207) [#4207](https://github.com/lovell/sharp/pull/4207)
[@calebmer](https://github.com/calebmer) [@calebmer](https://github.com/calebmer)
* Add support for RGBE images. Requires libvips compiled with radiance support.
[#4316](https://github.com/lovell/sharp/pull/4316)
[@florentzabera](https://github.com/florentzabera)
## v0.33 - *gauge* ## v0.33 - *gauge*
Requires libvips v8.15.3 Requires libvips v8.15.3

View File

@ -250,6 +250,7 @@ namespace sharp {
case ImageType::FITS: id = "fits"; break; case ImageType::FITS: id = "fits"; break;
case ImageType::EXR: id = "exr"; break; case ImageType::EXR: id = "exr"; break;
case ImageType::JXL: id = "jxl"; break; case ImageType::JXL: id = "jxl"; break;
case ImageType::RAD: id = "rad"; break;
case ImageType::VIPS: id = "vips"; break; case ImageType::VIPS: id = "vips"; break;
case ImageType::RAW: id = "raw"; break; case ImageType::RAW: id = "raw"; break;
case ImageType::UNKNOWN: id = "unknown"; break; case ImageType::UNKNOWN: id = "unknown"; break;
@ -296,6 +297,8 @@ namespace sharp {
{ "VipsForeignLoadOpenexr", ImageType::EXR }, { "VipsForeignLoadOpenexr", ImageType::EXR },
{ "VipsForeignLoadJxlFile", ImageType::JXL }, { "VipsForeignLoadJxlFile", ImageType::JXL },
{ "VipsForeignLoadJxlBuffer", ImageType::JXL }, { "VipsForeignLoadJxlBuffer", ImageType::JXL },
{ "VipsForeignLoadRadFile", ImageType::RAD },
{ "VipsForeignLoadRadBuffer", ImageType::RAD },
{ "VipsForeignLoadVips", ImageType::VIPS }, { "VipsForeignLoadVips", ImageType::VIPS },
{ "VipsForeignLoadVipsFile", ImageType::VIPS }, { "VipsForeignLoadVipsFile", ImageType::VIPS },
{ "VipsForeignLoadRaw", ImageType::RAW } { "VipsForeignLoadRaw", ImageType::RAW }

View File

@ -147,6 +147,7 @@ namespace sharp {
FITS, FITS,
EXR, EXR,
JXL, JXL,
RAD,
VIPS, VIPS,
RAW, RAW,
UNKNOWN, UNKNOWN,

View File

@ -119,7 +119,7 @@ Napi::Value format(const Napi::CallbackInfo& info) {
Napi::Object format = Napi::Object::New(env); Napi::Object format = Napi::Object::New(env);
for (std::string const f : { for (std::string const f : {
"jpeg", "png", "webp", "tiff", "magick", "openslide", "dz", "jpeg", "png", "webp", "tiff", "magick", "openslide", "dz",
"ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl" "ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl", "rad"
}) { }) {
// Input // Input
const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str()); const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str());