Skip to content

fix: adjust scale_factor after corrected image downscale#19

Merged
jasonmadigan merged 1 commit into
tracefinity:mainfrom
715d:main
Apr 1, 2026
Merged

fix: adjust scale_factor after corrected image downscale#19
jasonmadigan merged 1 commit into
tracefinity:mainfrom
715d:main

Conversation

@715d

@715d 715d commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

The corrected image (produced at 10 px/mm) was being downscaled to 2048px max dimension for storage, but scale_factor was not adjusted. This caused traced tool dimensions to be too small by the downscale ratio — e.g. a 5000px-tall corrected image shrunk to 2048px would produce tools at ~41% of their real size.

_downscale_image() now returns the downscale ratio, and set_corners() divides scale_factor by it so pixel→mm conversion stays correct.

Fixes #18

The corrected image (produced at 10 px/mm) was being downscaled to
2048px max dimension for storage, but scale_factor was not adjusted.
This caused traced tool dimensions to be too small by the downscale
ratio — e.g. a 5000px-tall corrected image shrunk to 2048px would
produce tools at ~41% of their real size.

_downscale_image() now returns the downscale ratio, and set_corners()
divides scale_factor by it so pixel→mm conversion stays correct.

Fixes tracefinity#18
@jasonmadigan

Copy link
Copy Markdown
Collaborator

thanks for spotting and fixing @715d!

@jasonmadigan
jasonmadigan merged commit aceb2fe into tracefinity:main Apr 1, 2026
1 check passed
shanetinklenberg pushed a commit to shanetinklenberg/tracefinity that referenced this pull request Jun 28, 2026
fix: adjust scale_factor after corrected image downscale
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.

Automatic scaling not working

2 participants