mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
stbi: more clear panic message
This commit is contained in:
parent
fb148e0b61
commit
793d2ce6dc
@ -38,7 +38,7 @@ pub fn load(path string) Image {
|
|||||||
flag := if ext == 'png' { C.STBI_rgb_alpha } else { 0 }
|
flag := if ext == 'png' { C.STBI_rgb_alpha } else { 0 }
|
||||||
res.data = C.stbi_load(path.str, &res.width, &res.height, &res.nr_channels, flag)
|
res.data = C.stbi_load(path.str, &res.width, &res.height, &res.nr_channels, flag)
|
||||||
if isnil(res.data) {
|
if isnil(res.data) {
|
||||||
panic('stbi image failed to load')
|
panic('stbi image failed to load from "$path"')
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user