GIFTranslator: Read the left and top image coordinates
This commit is contained in:
parent
5a7193d558
commit
4389d32381
@ -263,6 +263,8 @@ GIFLoad::ReadGIFImageHeader()
|
|||||||
if (fInput->Read(data, 9) < 9)
|
if (fInput->Read(data, 9) < 9)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
int left = data[0] + (data[1] << 8);
|
||||||
|
int top = data[2] + (data[3] << 8);
|
||||||
int localWidth = data[4] + (data[5] << 8);
|
int localWidth = data[4] + (data[5] << 8);
|
||||||
int localHeight = data[6] + (data[7] << 8);
|
int localHeight = data[6] + (data[7] << 8);
|
||||||
if (fWidth != localWidth || fHeight != localHeight) {
|
if (fWidth != localWidth || fHeight != localHeight) {
|
||||||
@ -284,7 +286,7 @@ GIFLoad::ReadGIFImageHeader()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BRect rect(0, 0, fWidth - 1, fHeight - 1);
|
BRect rect(left, top, left + fWidth - 1, top + fHeight - 1);
|
||||||
TranslatorBitmap header;
|
TranslatorBitmap header;
|
||||||
header.magic = B_HOST_TO_BENDIAN_INT32(B_TRANSLATOR_BITMAP);
|
header.magic = B_HOST_TO_BENDIAN_INT32(B_TRANSLATOR_BITMAP);
|
||||||
header.bounds.left = B_HOST_TO_BENDIAN_FLOAT(rect.left);
|
header.bounds.left = B_HOST_TO_BENDIAN_FLOAT(rect.left);
|
||||||
|
Loading…
Reference in New Issue
Block a user