Repository navigation
Commit 138119b
Keep thin bitmap thumbnails nonempty (colmap#4927)
`Bitmap::Thumbnail` rounds both scaled dimensions to the nearest
integer. When a nonempty image is much thinner than its long side, the
short side rounds to zero. For example, thumbnailing a 100x1 image to
maximum size 10 currently produces an empty 10x0 bitmap. Feature
extraction delegates its downscaling to this method.
Keep each target dimension at least one pixel. Ordinary thumbnail
dimensions, the returned scale, no-upscale behavior and both existing
resize filters stay unchanged.
The new native regression covers portrait and landscape inputs,
grayscale and RGB, both filters, constant pixel values and a repeated
thumbnail call. It fails on pristine main and passes with the fix. All
89 bitmap tests pass with MSVC Release and the existing OpenImageIO
dependency; all 88 original cases also pass against pristine production.
Clang-format and whitespace checks pass. Local Clang-Tidy reports the
same six pre-existing source/header diagnostics on base and patch, with
none in the changed method.
I did not run the full feature-extraction controller, reconstruction
datasets, GPU builds or other operating systems locally.
AI assistance disclosure: AI-assisted development tools were used during
investigation and implementation. The reported tests were run against
the final diff.
---------
Co-authored-by: Paul-Edouard Sarlin <[email protected]>1 parent f664d5d commit 138119b
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
592 | | - | |
| 591 | + | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
488 | 500 | | |
489 | 501 | | |
490 | 502 | | |
| |||
0 commit comments