Skip to content

RAW photos previews using exiftool #1840

@giovariot

Description

@giovariot

Is your feature request related to a problem? Please describe.
I've noticed RAW files are currently unsupported by the website, they are correctly shown as pictures files with a generic picture icon. I think adding support for thumbnailing and preview could be quite easy to implement.

Describe the solution you'd like
Most of the raw files I know how actually already contain a jpeg formatted thumbnail and preview file.
You can output them with the following exiftool commands:

  • Thumbnail: exiftool -b -ThumbnailImage sample1.cr2 > thumbnail.jpg
  • Preview: exiftool -b -PreviewImage sample1.cr2 > preview.jpg

Here is a table generated with gemini of all the raw formats containing previews

Manufacturer File Extension(s) Embedded Thumbnail Large Preview Notes
Canon .CR2, .CR3, .CRW Yes Yes .CR3 (newer) can embed very high-quality previews.
Nikon .NEF, .NRW Yes Yes Typically embeds a full-resolution JPEG.
Sony .ARW, .SRF, .SR2 Yes Variable Older models often used reduced-res previews.
Fujifilm .RAF Yes Variable Often embeds a medium-res preview rather than full.
Adobe .DNG Yes Yes Fully customizable; newer "lossy" DNGs use JPEG XL.
Olympus / OM .ORF, .ORI Yes Yes .ORI is often a secondary file for specific modes.
Panasonic .RW2, .RAW, .RWL Yes Yes .RWL is shared with Leica systems.
Pentax .PEF, .PTX Yes Yes High compatibility with DNG (can often switch in-camera).
Leica .DNG, .RWL Yes Yes Most modern Leicas use standard DNG.
Hasselblad .3FR, .FFF Yes Yes .FFF is the "native" format for digital backs.
Phase One .IIQ Yes Yes "Intelligent Image Quality"—embeds high-res previews.
Mamiya .MEF Yes Yes Legacy medium format; usually standard TIFF-based.
Leaf .MOS Yes Yes Used by Leaf Aptus/Valeo digital backs.
Sigma .X3F Yes Yes Unique "Foveon" sensor data; usually has a full JPEG.
Kodak .DCR, .KDC, .K25 Yes Variable Some legacy .K25 files only have tiny thumbnails.
Samsung .SRW Yes Yes Found in the now-discontinued NX series.
Epson .ERF Yes Yes Specifically for the R-D1 rangefinder series.
Casio .BAY Yes Yes Used in older Exilim high-speed cameras.
Blackmagic .BRAW Yes Yes Designed for video; uses a sidecar/embedded hybrid.
RED Cinema .R3D Yes Yes Usually requires specific SDKs to view the preview.
GoPro .GPR Yes Yes A "General Purpose RAW" based on the DNG spec.
Ricoh .DNG Yes Yes Ricoh was an early adopter of the universal DNG standard.
Minolta .MRW Yes Yes Legacy format for DiMAGE series; usually high-res preview.
Sinar .CS1, .STI Yes Yes High-end studio cameras; very structured metadata.
Logitech .PXN Yes No Extremely rare legacy format; mostly tiny thumbnails.

Describe alternatives you've considered
LibRaw too should enable the fast extraction of previews and thumbnails, with also support for some types of custom DNG files that are missing a proper preview. Here is another table I created with gemini to summarize the different methods

Stage Target Primary Method (Fastest) Failsafe Method (Back-up) LibRaw Efficiency Logic
Thumbnail ~160px icons unpack_thumb() Downsampled Linear Decode If unpack_thumb() fails, run unpack() with params.half_size = 1 and further downscale the buffer.
Preview 1080p - 4K unpack_thumb()* Half-Size Demosaic Use params.user_qual = 0 (Bilinear) and params.half_size = 1 for a "good enough" view at 4x speed.
Full View Full Res N/A Standard Process params.user_qual = 3 (AHD) or better. This is the "slow" lane; no shortcuts here.

*Note: Many modern cameras embed a full-size JPEG in the thumbnail slot

Additional context
This would allow to save lots of bandwidth server-side since most user could simply decide to download only a few files they're interested in instead of downloading whole folders.
I also think this extraction could easily be done client-side with exiftool and libraw libraries support and ports for multiple programming languages

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