Review ExportImage() to use SaveFileData() #1779
This commit is contained in:
parent
23a08a483e
commit
4a099c3658
1 changed files with 7 additions and 1 deletions
|
@ -416,7 +416,13 @@ bool ExportImage(Image image, const char *fileName)
|
|||
}
|
||||
|
||||
#if defined(SUPPORT_FILEFORMAT_PNG)
|
||||
if (IsFileExtension(fileName, ".png")) success = stbi_write_png(fileName, image.width, image.height, channels, imgData, image.width*channels);
|
||||
if (IsFileExtension(fileName, ".png"))
|
||||
{
|
||||
int dataSize = 0;
|
||||
unsigned char *fileData = stbi_write_png_to_mem((const unsigned char *)imgData, image.width*channels, image.width, image.height, channels, &dataSize);
|
||||
success = SaveFileData(fileName, fileData, dataSize);
|
||||
RL_FREE(fileData);
|
||||
}
|
||||
#else
|
||||
if (false) {}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue