Skip to content

Read the embedded JPEG preview #3

Closed

Description

@sputier

Goal

Expose the JPEG previews stored in the file (a NEF holds several, of different sizes) without decoding any raw pixel.

Proposal

  • RawFile.ReadPreviewJpegAsync(CancellationToken) returns the bytes of the largest preview, or null when the file has none; a way to list the available previews (size, byte count).
  • Reads only the bytes of the preview (one read), into memory owned by the caller or pooled.

Acceptance criteria

  • Works for little- and big-endian files, with several previews, with none, and with a preview that extends beyond the end of the file (CorruptRawFileException).
  • Allocation budget checked by a test; benchmark added.

Activity

  1. added
    enhancement
    on Nov 18, 2026
  2. sputier commented on Nov 18, 2026

    @sputier
    OwnerAuthor

    Done in #15.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions