Fix colour shift in Crop function due to not multiplying x position by colours
This commit is contained in:
parent
70313ce152
commit
c0eb790e45
|
@ -1416,8 +1416,8 @@ bool Image::Crop( unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsig
|
|||
|
||||
unsigned int new_stride = new_width * colours;
|
||||
for ( unsigned int y = lo_y, ny = 0; y <= hi_y; y++, ny++ ) {
|
||||
unsigned char *pbuf = &buffer[((y*linesize)+lo_x)];
|
||||
unsigned char *pnbuf = &new_buffer[(ny*new_width)*colours];
|
||||
unsigned char *pbuf = &buffer[((y*linesize)+(lo_x*colours))];
|
||||
unsigned char *pnbuf = &new_buffer[ny*new_stride];
|
||||
memcpy(pnbuf, pbuf, new_stride);
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 14292374ccf1328f2d5db20897bd06f99ba4d938
|
||||
Subproject commit 0bd63fb464957080ead342db58ca9e01532cf1ef
|
Loading…
Reference in New Issue