Skip to content
Myr

stb_image_write: Fix JPEG writer bug.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Fabian Giesen · committed by Fabian Giesen · parent 59e9702 · Browse files · 1 file+4 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−8 removed

  • other:+4 added−8 removed

1 file+4 added−8 removed

modified:stb_image_write.h+4 added-8 removed
1474 unmodified lines
1475 for(y = 0; y < height; y += 8) {1476 for(x = 0; x < width; x += 8) {1477 float YDU[64], UDU[64], VDU[64];1478 for(row = y, pos = 0; row < y+8; ++row) {1479 int p;1480 if(row < height) {1481 p = (stbi__flip_vertically_on_write ? (height-1-row) : row)*width*comp;1482 } else {1483 // row >= height => use last input row (=> first if flipping)1484 p = stbi__flip_vertically_on_write ? 0 : ((height-1)*width*comp);1485 }1479 // row >= height => use last input row1480 int clamped_row = (row < height) ? row : height - 1;1481 int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;1482 for(col = x; col < x+8; ++col, ++pos) {1483 float r, g, b;1484 // if col >= width => use pixel from last input column1489 p += ((col < width) ? col : (width-1))*comp;1485 int p = base_p + ((col < width) ? col : (width-1))*comp;14861487 r = imageData[p+0];1488 g = imageData[p+ofsG];1489 b = imageData[p+ofsB];
132 unmodified lines