Skip to content

crop definition in imx477.c causing Picamera2 Scalercrop to return distorted frames #7321

@sandyol55

Description

@sandyol55

Describe the bug

As per https://forums.raspberrypi.com/viewtopic.php?p=2372435#p2372290 when using ScalerCrop with the 4056 x 2160 modes, distorted images are returned.
Also the reported modes in rpicam-hello --list-cameras show a 3040 crop for the 16:9 12 Mpix modes when it should be 2160.

Appears to be related to the imx477.c crop definition for these modes,

Replacing the 3040 by 2160 in the crop definition of the 12Mpix 16: modes in line 880 onwards , as below

	/* 12MPix cropped 16:9  mode */
	.width = 4056,
	.height = 2160,
	.crop = {
		.left = IMX477_PIXEL_ARRAY_LEFT,
		.top = IMX477_PIXEL_ARRAY_TOP + 440,
		.width = 4056,
		.height = **3040**, 2160

seems to resolve the issue.

Steps to reproduce the behaviour

Implement a scalerCrop in picamera2 while in mode 3 as per forum issue above, and observe distorted frames.

Device (s)

Raspberry Pi 5

System

Raspberry Pi reference 2025-10-01
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 7dadcf1fc5ce1648ab09409ab978831690c9a955, stage4

2026/02/23 10:01:39
Copyright (c) 2012 Broadcom
version 85353ce4 (release) (embedded)

Linux FlyTip 6.12.75+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2026-03-11) aarch64 GNU/Linux

Logs

No response

Additional context

No response

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