Don't encode Images upside down anymore;

This commit is contained in:
bjorn 2022-07-13 23:59:35 -07:00
parent bca10c9e98
commit f5ec2e9158
1 changed files with 2 additions and 2 deletions

View File

@ -323,8 +323,8 @@ Blob* lovrImageEncode(Image* image) {
lovrAssert(image->format == FORMAT_RGBA8, "Only images with the rgba8 format can be encoded");
uint32_t w = image->width;
uint32_t h = image->height;
uint8_t* pixels = (uint8_t*) image->blob->data + (h - 1) * w * 4;
int32_t stride = -1 * (int) (w * 4);
uint8_t* pixels = (uint8_t*) image->blob->data;
uint32_t stride = (int) (w * 4);
// The world's worst png encoder
// Encoding uses one unfiltered IDAT chunk, each row is an uncompressed huffman block