microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.85k stars 6.31k forks source link

[libraw] update to snapshot 202101 #16267

Closed jedfrechette closed 1 year ago

jedfrechette commented 3 years ago

Library name: LibRaw

New version number: Snapshot 202101

Other information that may be useful (release notes, etc...)

== LibRaw snapshot 202101 ==

= Camera format support: = Lossy compressed CR3 files Lossy compressed RAF files Uncompressed floating point DNG files (16-24-32 bit) Deflate compressed striped DNG files XMP and HEIF-preview extraction from CR3 files

= Camera support = Apple iPhone 12 Max, iPhone 12 Max Pro Canon EOS R5, EOS R6, EOS 850D, EOS-1D X Mark III (lossy compressed files) FujiFilm X-S10 Hasselblad CFV II 50C", Leica M10-R, Q2 Monochrom, S3, SL2-S Nikon Z 5, Z 6 II, Z 7 II Olympus E-M10 Mark IV Panasonic DC-G100 / G110, DC-S5 Sony ILCE-7C (A7C), ILCE-7SM3 (A7S III) Zeiss ZX1 Plus multiple DNG-recording cameraphones/drones/etc.

= Almost dropped camera support: = Old/partially supported video/cinema cameras support is available only if LibRaw is compiled with USE_OLD_VIDEOCAMS defined (this #define is converted internally to LIBRAW_OLD_VIDEO_SUPPORT defined). This affects: Arri cameras Canon C500 RED Cine cameras We plan to keep the support in LibRaw 0.21 (if compiled with define mentioned above) and completely drop the support after 0.21. If you're using LibRaw to decode RED Cine files, see LibRaw*datastreams section below (in short: you'll need to use old fstream-based datastream under Windows). Cinema DNG files are not affected by this.

= API/ABI changes =

2020-10-14 Alex Tutubalin lexa@lexa.ru

2020-10-14 Alex Tutubalin lexa@lexa.ru

2020-07-23 Alex Tutubalin lexa@lexa.ru

== Camera Format support == Canon CR3 GoPro (via GPR SDK) Panasonic 14-bit Fujifilm compressed/16bit Rapsberry Pi RAW+JPEG format (if USE_6BY9RPI defined) Foveon X3F support changed: it is supported only if USE_X3FTOOLS defined at build (see below for 'Imported code policy changed')

== Camera support (+59, 1131 total) == Canon: PowerShot G5 X Mark II, G7 X Mark III, SX70 HS, EOS R, EOS RP, EOS 90D, EOS 250D, EOS M6 Mark II, EOS M50, EOS M200 EOS 1DX Mark III (lossless files only) DJI Mavic Air, Osmo Action FujiFilm GFX 100, X-A7, X-Pro3, X100V, X-T4 (uncompressed/lossless compressed only), X-T200 GoPro Fusion, HERO5, HERO6, HERO7, HERO8 Hasselblad L1D-20c, X1D II 50C Leica D-LUX7, Q-P, Q2, V-LUX5, C-Lux / CAM-DC25, SL2, M10 Monochrom Nikon D780, Z50, P950 Olympus TG-6, E-M5 Mark III, E-PL10, E-M1 Mark III, Panasonic DC-FZ1000 II, DC-G90, DC-S1, DC-S1R, DC-S1H, DC-TZ95 PhaseOne IQ4 150MP Ricoh GR III Sony A7R IV, A9 II, ILCE-6100, ILCE-6600, RX0 II, RX100 VII Zenit M

also multiple smartphones (the tested ones are listed in LibRaw::cameraList)

== Source code re-arranged ==

== Normalized make/model ==

There is a huge number of identical cameras sold under different names, depending on the market (e.g. multiple Panasonic or Canon models) and even some identical cameras sold under different brands (Panasonic -> Leica, Sony -> Hasselblad).

To reduce clutter, a normalization mechanism has been implemented in LibRaw:

In imgdata.idata: char normalized_make[64]; - primary vendor name (e.g. Panasonic for Leica re-branded cameras) char normalized_model[64]; - primary camera model name unsigned maker_index; - primary vendor name in indexed form (enum LibRaw_cameramaker_index, LIBRAWCAMERAMAKER* constant). These fields are always filled upon LibRaw::open_file()/open_buffer() calls.

const char* LibRaw::cameramakeridx2maker(int index): converts maker_index to normalized_make.

We recommend that you use these normalized names in a variety of data tables (color profiles, etc.) to reduce the number of duplicate entries.

New vendor index values will be added strictly to the end of the LibRaw_cameramaker_index table, ensuring that the numbers assigned to vendors that are already known to LibRaw will not change.

== DNG frame selection ==

DNG frames selection code re-worked:

== Imported code policy disclaimer ==

We've changed the policy regarding 3rd party code imported into LibRaw.

We (like other authors of open-source RAW parsers) gladly import support code for various RAW formats from other projects (if the license allows it). This is done to expand camera support. Unfortunately, not all imported code can tolerate truncated or otherwise damaged raw files, as well as arbitrary conditions or arbitrary data; not all authors handle rejecting unexpected input well.

LibRaw is now widely used in various projects, including ImageMagick, which, in turn, is often used on web sites to process any input images, including arbitrary data from unknown users. This opens up wide possibilities for exploiting the various vulnerabilities present in the code borrowed from other projects into LibRaw. In order to avoid such security risks, - the borrowed code will no longer compile by default. We are not able to support it in general case, and the authors refuse to add code to reject unexpected input.

Thus, if you use some kind of camera for which the support is disabled by default, you need to recompile LibRaw for your specific case.

Formats currently affected: X3F (Foveon) file format. Code is imported from Kalpanika X3F tools: https://github.com/Kalpanika/x3f To turn the support on, define USE_X3FTOOLS

Rapsberry Pi RAW+JPEG format. Code is imported from https://github.com/6by9/dcraw/, To turn the support on, define USE_6BY9RPI Format support is indicated via LibRaw::capabilities() call with flags: LIBRAW_CAPS_X3FTOOLS - Foveon support LIBRAW_CAPS_RPI6BY9 - RPi RAW+JPEG support

== GoPro .gpr format support == GoPro format supported via open-source GPR SDK See README.GoPro.txt for details.

== Windows support/Windows unicode (wchar_t*) filenames support ==

== LibRaw*datastream simplified ==

== minor/unsorted changes ==

VioletGiraffe commented 1 year ago

We also need the latest libraw, so +1 for this request. Additionally, could you add a feature to build just the libraw itself, without the examples and other unnecessary dependencies? This is how we build clean libraw:

cmake -DCMAKE_INSTALL_PREFIX=%CD%\%INSTALL_DIR% -DBUILD_SHARED_LIBS=OFF -DENABLE_OPENMP=OFF -DENABLE_LCMS=OFF -DENABLE_EXAMPLES=OFF -DCMAKE_DEBUG_POSTFIX=d ^
-DJPEG_INCLUDE_DIR=%CD%/jpeg/include -DJPEG_LIBRARY_DEBUG=%CD%/jpeg/lib/jpeg-staticd.lib -DJPEG_LIBRARY_RELEASE=%CD%/jpeg/lib/jpeg-static.lib ^ 

The dependencies on jasper, lcms are not needed for libraw functionality, or at the very least we don't understand what they are needed for and we never found a use case despite using "bare" version of libraw (as described above) quite heavily in our software. It's not clear where the jasper dependency even came from.

Here's the full list of configurable libraw features, of which only OpenMP is exposed by vcpkg:

// Build library with Raspberry Pi RAW support     (default=OFF)
ENABLE_6BY9RPI:BOOL=OFF

// Build library with debug message from dcraw     (default=OFF)
ENABLE_DCRAW_DEBUG:BOOL=OFF

// Build library with extra Demosaic pack GPL2     (default=OFF)
ENABLE_DEMOSAIC_PACK_GPL2:BOOL=OFF

// Build library with extra Demosaic pack GPL3     (default=OFF)
ENABLE_DEMOSAIC_PACK_GPL3:BOOL=OFF

// Build library with sample command-line programs (default=ON)
ENABLE_EXAMPLES:BOOL=OFF

// Build library with LCMS support                 (default=ON)
ENABLE_LCMS:BOOL=OFF

// Build library with OpenMP support               (default=ON)
ENABLE_OPENMP:BOOL=OFF

// Build library with extra RawSpeed codec support (default=OFF)
ENABLE_RAWSPEED:BOOL=OFF

// Build library with Foveon X3F support           (default=OFF)
ENABLE_X3FTOOLS:BOOL=OFF
jedfrechette commented 1 year ago

As of December 2022 there is a new major release of libraw:

https://github.com/LibRaw/LibRaw/releases/tag/0.21.1

This is the first major release since 0.20 was released in 2020 so it would be a great time to update this package.

The currently packaged snapshot predates the 0.20 release so is now 2 major releases behind and getting pretty long in the tooth.

aklemets commented 1 year ago

I have prepared an update of LibRaw to version 0.21.1. First, I have to make an update of the port to freeimage to avoid a build break. Once that is done, I will submit a PR for the LibRaw update.

aklemets commented 1 year ago

I have prepared an update of LibRaw to version 0.21.1. First, I have to make an update of the port to freeimage to avoid a build break. Once that is done, I will submit a PR for the LibRaw update.

@jedfrechette I am sorry, but I tried to update libraw to version 0.21.1 but some people on this GIT repo gave me a hard time with the necessary prerequisite: an update to a seemingly abandoned OSS project called "freeimage" (it hasn't had a new release since 2018.) I don't know if this is supposed to be normal but they gave me a hard time when I wanted to make a trivial fix to freeimage to avoid the build break that will otherwise occur after updating LibRaw to the latest version.

The amount of time I can spend on charity work to fix other people's software is strictly limited. I have abandoned the PR but you can still see my changes in my fork of the repo. The changes that I had in mind are here: https://github.com/microsoft/vcpkg/compare/master...aklemets:vcpkg:libraw-update

Please feel free to have at it and use it as you please.

dg0yt commented 1 year ago

@aklemets The changes were practically complete. Do you want somebody else to pick up your original work?

dg0yt commented 1 year ago

You may test https://github.com/microsoft/vcpkg/pull/29647.