Make a picture's size mean it shows, and keep pixels the size they say
ImageSource::size() read a raster file's header, so a cache file that was cut short or garbled after the header counted as showable, where the Slint version's decoded image was empty. A raster picture is now decoded to tell (the first frame, with the limits the Slint side uses) and an SVG must parse as XML with an svg root (roxmltree, already in the tree through the vector renderer); the answer is kept per file stamp, and per key and content hash for a downloaded picture, and decoding runs outside the lock. The size check of the pixel count no longer overflows on a header that claims u32::MAX. ImageSource::Rgba holds a Pixels value that can only be made with the right length, so the Slint conversion cannot hand clone_from_slice bytes that do not fit (it panics on that). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f92a14fc84
commit
d9de95b985
5 files changed
+224
-79
No files matched your search
Generated
+1
@@ -9764,6 +9764,7 @@ dependencies = [
|
||||
"image",
|
||||
"miniz_oxide 0.8.9",
|
||||
"png",
|
||||
"roxmltree",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"unicode-segmentation",
|
||||
|
||||
Reference in new issue
Block a user