1
0
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:
Alexander Medvednikov 2020-08-22 00:51:12 +02:00
parent fb148e0b61
commit 793d2ce6dc

View File

@ -38,7 +38,7 @@ pub fn load(path string) Image {
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)
if isnil(res.data) {
panic('stbi image failed to load')
panic('stbi image failed to load from "$path"')
}
return res
}