Repository navigation
LR-EDIT-OPTICS-PROFILE: Find a compact's built-in lens when the file names no lens (#3855) - #3868
Draft
endthestart wants to merge 1 commit into
Draft
endthestart wants to merge 1 commit into
endthestart wants to merge 1 commit into
Conversation
…names no lens (storytold#3855) A PowerShot G7 X CR2 has no lens name or specification, so the lookup stopped before trying the camera's own mount. Only fixed-lens cameras (lower-case mount names) get this fallback.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
emmertex
referenced
this pull request
in emmertex/chromaforge
Nov 17, 2026
A fixed-lens camera's raw that names no lens and records no lens specification (PowerShot G7 X CR2, RX100 II) now gets its camera's built-in lens from the lens database, found by the camera's own mount. find_built_in_lens now refuses a body (mount name starting with a capital, lensfun's convention for interchangeable mounts). The Optics panel status reports the found profile instead of "No lens named" for such photos. Render change: only for those compacts with profile corrections on, where a profile now applies. Left out: upstream's cmd/lens_refresh.rs part; the fork has no library-wide missing-profile refresh (lens.db.refresh re-reads the given ids). Adapted from upstream #3868 Manual: develop/lens.mdx Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
|
I rebased this onto current |
Contributor
This branch has not been deployed
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.

A PowerShot G7 X CR2 has no lens name and no lens specification, so the lens database lookup gave up before it looked at the camera. The database does have the lens. It's filed under the camera's own mount (
canonG7X), which is how the existing built-in lens match already finds it for compacts that write a focal range as the lens name.Now a file that names no lens falls back to its camera's built-in lens, and the library refresh picks up such photos that were imported earlier. I limited it to cameras whose mount name starts with a lower-case letter, which is how the lensfun data marks a fixed lens. Without that check a Pentax K-1 with an unnamed manual lens would have picked up the one Zeiss profile on its mount that has no "mm" in its name. If the mount has more than one profile (a converter variant, for example) the lens specification picks by focal range, and with no specification nothing is applied.
I added a test in
lens_profiles.rsthat fails on main, plus one inlensdbfor the mount check and one for the refresh. I also ran the lookup on the CC0 G7 X sample from raw.pixls.us (CANON_G7X_IMG_6738.CR2) with lensfun's database and it finds "Canon G7 X & compatibles". Across that database 363 of 1059 cameras get a built-in lens this way and none of them is a body with a lens mount.Let me know if you'd rather fix it another way. Thank you.
Fixes #3855