fix: mRAW/sRAW active-area crop uses wrong width for scale factor - #7
Open
Kheil-Z wants to merge 1 commit into
Open
fix: mRAW/sRAW active-area crop uses wrong width for scale factor#7Kheil-Z wants to merge 1 commit into
Kheil-Z wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CropDefault's scale-factor calculation using the wrong reference width for mRAW/sRAW files, which left part of the sensor's black border uncroppedactive_area's width whenDemosaicactually ran (and resizedintermediateto match it); otherwise fall back to the raw image's full widthWhy
CR2 files shot in Canon's mRAW mode render with a visible black border along the top/left edges in RapidRAW; the camera's own JPEG (same shot) has none. mRAW/sRAW files (
cpp == 3) skipDemosaicentirely (already-RGB data), sointermediateis still at full raw resolution at theCropDefaultstep, but the scale factor was computed againstactive_area's width (the already-cropped rectangle), which only matchesintermediate's resolution whenDemosaicactually ran and resized it to that ROI. This produced an incorrect scale factor and under-cropped the border.Validation
SensorLeftBorder/SensorTopBorderMakernote tags, read via exiftool):left=36, top=18crop: Rect{36:18, ...}-- exact match to the camera's declared border, and the visible border is gone[patch], both headless CLI export and normal GUI export, JPEG and 16-bit TIFF outputcargo check/cargo build --all-features/cargo check --all-featurespasscargo testblocked by the same pre-existing, unrelatedrawler/src/tiles.rs:334SubPixeltype-inference failure noted in other open PRs on this repo -- confirmed present on unmodifiedmainas well