mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Provide error messages when PNG save fails
This commit is contained in:
parent
b17b51d970
commit
cd99157e2e
@ -53,9 +53,9 @@ Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img
|
||||
|
||||
PoolVector<uint8_t> buffer;
|
||||
Error err = PNGDriverCommon::image_to_png(p_img, buffer);
|
||||
ERR_FAIL_COND_V(err, err);
|
||||
ERR_FAIL_COND_V_MSG(err, err, "Can't convert image to PNG.");
|
||||
FileAccess *file = FileAccess::open(p_path, FileAccess::WRITE, &err);
|
||||
ERR_FAIL_COND_V(err, err);
|
||||
ERR_FAIL_COND_V_MSG(err, err, vformat("Can't save PNG at path: '%s'.", p_path));
|
||||
|
||||
PoolVector<uint8_t>::Read reader = buffer.read();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user