Skip to content

Change crop struct to match height for 16 by 9 mode. Addresses #7321#7328

Merged
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
sandyol55:mode_3_Fix
Apr 22, 2026
Merged

Change crop struct to match height for 16 by 9 mode. Addresses #7321#7328
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
sandyol55:mode_3_Fix

Conversation

@sandyol55
Copy link
Copy Markdown
Contributor

Proposed correction to the struct definition of the full resolution 16:9 cropped modes to reflect the actual cropped height.

Tested and resolves both the issue of offset and distorted ScalerCrop images in Picamera2, and the crop definitions returned by rpi-cam apps --list-cameras.

@davidplowman
Copy link
Copy Markdown
Contributor

Thanks for the PR. The fix looks fine (it's not too involved, after all!), I think it's just complaining about the commit message format. Maybe just have a look at some of the other commits made to this file and copy one of those (with a subject line usually starting with a list of parent folders, and a Signed-off-by line). Do ask if you have any questions. Thanks!

@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 22, 2026

The code change itself looks OK - you've changed a number, so the new value is either correct or it isn't. Not my department.

If you look at the results of the automated checks above you'll see that checkpatch has some objections:

WARNING: Missing commit description - Add an appropriate one
ERROR: Missing Signed-off-by: line(s)

It would be great if you could:

  1. Try and follow the commit naming conventions - use the common prefix (look at git log -- drivers/media/i2c/imx477.c and do the same), and ideally keep the title no longer than 50 characters.
  2. In the commit message, leave a blank line after the title, then have at least a sentence saying what the patch does. Keep these lines to 72 characters.
  3. Include a Signed-off-by: line - mine is:
Signed-off-by: Phil Elwell <phil@raspberrypi.com>

If you have configured git correctly you can just include the -s parameter in the git commit arguments.

Struct definition doesn't match the cropped height of the mode

causing Picamera2 ScalerCrop to distort any cropped images.

Also causes the rpi-cam apps --list-cameras to report an incorrect mode crop height.

Signed-off-by: Sandy Sutherland <ao_sutherland@outlook.com>
@sandyol55
Copy link
Copy Markdown
Contributor Author

sandyol55 commented Apr 22, 2026

Thanks for the guidance.
I've locally git commit --amend (ed) the description to

commit 05f881cf306a81beb27c7a0fcd7a6b6dc47f9421 (HEAD -> mode_3_Fix)
Author: sandyol55 ao_sutherland@outlook.com
Date: Tue Apr 21 22:07:51 2026 +0100

media: i2c: imx477: Fix crop height in 12Mpix 16:9 struct

Struct definition doesn't match the cropped height of the mode, 
causing Picamera2 ScalerCrop to distort any cropped images.

Also causes the rpi-cam apps --list-cameras to report an incorrect mode crop height.

Signed-off-by: Sandy Sutherland <ao_sutherland@outlook.com>

But have failed to understand/follow the correct steps to incorporate this in PR. Any suggestions/guidance?

Thanks

Sandy

@popcornmix
Copy link
Copy Markdown
Collaborator

After amending a commit, git push -f should update the PR.

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 22, 2026

If you've amended your local branch, git push -f <remote> HEAD:<branch name> will update the branch on Github. If that branch is your mode_3_Fix branch then that will be automatically reflect in this PR.
(-f is for force push, overwriting whatever was there before. git will reject the push otherwise).

@sandyol55
Copy link
Copy Markdown
Contributor Author

sandyol55 commented Apr 22, 2026

Thanks for the guidance all.
Floundered around a bit, but I think it's now updated?

Edit. I see it is still failing. I can try again later with a shorter text line and making sure the github name and signed-off-by name match?

@pelwell pelwell merged commit 258d857 into raspberrypi:rpi-6.12.y Apr 22, 2026
11 of 12 checks passed
@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 22, 2026

It's fine - the email address vs GitHub handle doesn't matter to us, and we get a chance to fix a single commit message by squashing it.

Thanks for your submission.

@sandyol55 sandyol55 deleted the mode_3_Fix branch April 22, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants