KhronosGroup / KhronosGroup/glTF-Compressor
Odd texture sizes crash the compressor
- Dominant language
- JavaScript
- Stars
- 83
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Found by one of our internal artists. There was a model that had a bunch of 2048 x 2048 textures, but also had a handful of odd-size things like 349 x 150 or some such. The controls were set for 4x downsampling, and the compressor crashes with a message "width must be a positive integer." It was dividing the image dimensions by 4, not rounding the result, and throwing an exception on the resulting invalid image size.
Ideally, it should not crash in this situation, for example it could round off the smaller image size.
As a bonus, it would be great to have some option to only downsample the larger images that need downsampling, and ignore the smaller images. Deselecting them manually from the list is a tedious process for models with lots of textures, perhaps there could be a filter to select images of a certain size or minimum size.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no source file, test, or entry point. Reproduce compression with an odd-sized texture and 4x downsampling, then locate the dimension calculation and add coverage showing that invalid output sizes no longer crash; the optional size-based selection filter is a separate enhancement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100