Skip to content

Default to YUV_400 format for .raw extension files (RAW Bayer / CFA patterns) #663

Description

@for13to1

Describe the bug

As the author who originally introduced the RAW file support feature to YUView, I wanted to fix a minor logical fallback discrepancy regarding .raw files.
In YUView, .raw extension files (defined in RAW_BAYER_EXTENSIONS) are treated as raw Bayer/CFA sensor data. Since YUView uses YUV_400 (luma-only / single Y plane) internally to represent single-channel raw files, these files should default to the YUV_400 format.

However, if a .raw file is opened without resolution indicators in the filename, the format guesser is bypassed, and the video handler defaults to YUV_420 (the constructor fallback). This forces users to manually switch the format dropdown to YUV 4:0:0 in the properties panel every time they open a clean .raw file.

Additionally, in checkSpecificFileExtensions inside PixelFormatYUVGuess.cpp, there is a potential crash hazard where guessedFrameFormat.frameSize is dereferenced without checking if it has a value.

To Reproduce

Steps to reproduce the behavior:

  1. Open a raw video file named 1.raw (which does not contain resolution indicators like _1920x1080_ in its filename).
  2. Look at the properties panel.
  3. See that the pixel format defaults to YUV 4:2:0.

Expected behavior

The .raw file should default to YUV 4:0:0 (YUV_400 luma-only) format upon loading, allowing the user to only manually input the width/height in the properties GUI.

Screenshots

N/A

Version

  • OS: Windows / macOS / Linux
  • Version: develop branch, commit a72eb34 or later
  • If you compiled YUView yourself then which Qt version did you use? Qt 6.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions