Skip to content

ARW: support uncompressed (type 1) and lossy (type 8) compression #64

Description

@justin13888

rawshift-image-arw decodes only lossless-JPEG ARW (compression type 7). Everything else returns RawError::Unsupported, so those files cannot be opened at all.

From crates/rawshift-image-arw/src/decoder.rs (master):

// after the `compression == 7` path
match metadata.compression {
    8 => Err(RawError::Unsupported(
        "Sony Compressed (Type 8) not yet supported. Only Uncompressed/LJPEG (Type 7) is supported."
    )),
    _ => Err(RawError::Unsupported(format!(
        "Compression type {} not yet supported (only JPEG type 7 is supported)",
        metadata.compression
    ))),
}

Gaps

  • Type 1 — uncompressed. Falls through to the _ arm. 12/14-bit packed sensor data; the simplest of the three to add.
  • Type 8 — Sony lossy (ARW2). 7-bit delta encoding over 32-pixel blocks with per-block min/max; well documented across dcraw, LibRaw and rawloader.

Aside

The type-8 message reads "Only Uncompressed/LJPEG (Type 7) is supported" — but uncompressed is type 1 and unsupported, so that string is misleading either way. Worth fixing with the substance.

Test coverage

rawshift-test-fixtures currently carries only lossless ILCE-6700 files, so both variants need fixtures. raw.pixls.us has CC0 samples covering uncompressed and lossy Sony bodies; happy to source and ingest them via ingest.sh if useful.

Why

Focale (Capsulsaurus/Focale#12) targets Sony ARW as its first-class format and currently surfaces a typed per-file error for these two variants. It is the only thing blocking that issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions