Skip to content

Commit 5395a44

Browse files
committed
fix(image): enable iPhone PNG conversion in nvgCreateImageMem
1 parent f93799c commit 5395a44

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/nanovg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ int nvgCreateImage(NVGcontext* ctx, const char* filename, int imageFlags)
814814
int nvgCreateImageMem(NVGcontext* ctx, int imageFlags, unsigned char* data, int ndata)
815815
{
816816
int w, h, n, image;
817+
stbi_set_unpremultiply_on_load(1);
818+
stbi_convert_iphone_png_to_rgb(1);
817819
unsigned char* img = stbi_load_from_memory(data, ndata, &w, &h, &n, 4);
818820
if (img == NULL) {
819821
// printf("Failed to load %s - %s\n", filename, stbi_failure_reason());

0 commit comments

Comments
 (0)