Return fallback image if remote fetch fails
This commit is contained in:
@@ -30,6 +30,7 @@ func GetRemoteImage(url):
|
|||||||
error = image.load_jpg_from_buffer(res[3])
|
error = image.load_jpg_from_buffer(res[3])
|
||||||
if error != OK:
|
if error != OK:
|
||||||
print("Error fetching image ", str(error))
|
print("Error fetching image ", str(error))
|
||||||
|
image.load("res://assets/fallback_card.png")
|
||||||
image.save_png(outFile)
|
image.save_png(outFile)
|
||||||
print("Saved new image to cache. " + outFile)
|
print("Saved new image to cache. " + outFile)
|
||||||
return image
|
return image
|
||||||
|
|||||||
BIN
assets/fallback_card.png
Normal file
BIN
assets/fallback_card.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 204 KiB |
Reference in New Issue
Block a user