OpenImageIO: [BUG] Sony ARW medium and small compression 15 bit per sample files are unsupported

Describe the bug

Importing a Sony ARW Medium or Small compression file with 15 bits per sample is unsupported in OIIO.

Other Sony ARW Medium or Small compression files which are not 15 bits per sample open correctly and are supported.

OpenImageIO version and dependencies

oiiotool --buildinfo
OIIO 2.5.12.0 | MacOS/ARM
    Build compiler: Apple clang 15.0 | C++14/201402
    HW features enabled at build: neon
Dependencies: Boost 1.85.0, BZip2 1.0.8, FFmpeg 6.0, fmt 10.2.1, Freetype
    2.13.2, GIF 5.2.2, Libheif 1.17.6, libjpeg-turbo 3.0.3, LibRaw 0.21.2,
    OpenColorIO 2.3.2, OpenEXR 3.2.4, OpenVDB NONE, PNG 1.6.43, pugixml 1.14,
    pybind11 2.12.0, Python 3.12.3, Robinmap, TBB 2021.12.0, TIFF 4.6.0, WebP
    1.4.0, ZLIB 1.2.12

To Reproduce

Steps to reproduce the behavior:

  1. Download the ARW file
  2. Try to convert to a different format with OIIO
  3. This error appears.
  4. I expected it to output.
oiiotool /Users/topazlabs/Downloads/A1A04973.ARW -o ~/Downloads/arw.png
oiiotool ERROR: read : Could not open file "/Users/topazlabs/Downloads/A1A04973.ARW", Unsupported file format or not RAW file
Full command line was:
> oiiotool /Users/topazlabs/Downloads/A1A04973.ARW -o /Users/topazlabs/Downloads/arw.png

Evidence

https://www.dropbox.com/scl/fi/y19jqq4q3rh1wv7810048/A1A04973.ARW?rlkey=pnrdm0oo0hlpbkep1goczk1da&st=ij4br4bn&dl=0

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@lgritz Please take look on our update policy: https://www.libraw.org/#updatepolicy (same on GitHub page, but I do not know how to point to specific sections).

Our snapshots are carefully tested against normal user case (no specifically crafted files e.g. from fuzzers, but normal files from user cameras). These snapshots are published as master branch and not tagged (it does not make sense, see below). After such publishing, only very minor fixes are added (including ones inspired by OSS-fuzz and similar).

So, LibRaw/master is generally OK for end-user cases: no unknown data sources (e.g. fuzzed/specially crafted files) just files from user’s camera. It is not recommended to use in services opened to everyone (e.g. processing anonymous users uploads).

@lingyukongt Please make sure you use actual LibRaw public header files (libraw.h) when building the wrapper you use (OpenImageIO):

LibRaw snapshots are NOT binary (ABI) compatible unless such compatibility is declared (e.g. within single major version: 0.21.0, 0.21.1, 0.21.x). Internal layout may change without notice, while our C++ api do not isolate this.

Alternatively, use LibRaw C API, that provides such isolation.