Commit 82b781f5 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk
Browse files

Auto-detect Endianess of image data by looking at width value.



Change-Id: I403fe7dcf841129e4c24b2c2787f58aa94540c6e
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 7bc0818d
......@@ -1678,7 +1678,8 @@ void WatchHandler::showEditValue(const WatchData &data)
if (data.editformat == DisplayImageData) {
ba = QByteArray::fromHex(data.editvalue);
const int *header = (int *)(ba.data());
swapEndian(ba.data(), ba.size());
if (!ba.at(0) && !ba.at(1)) // Check on 'width' for Python dumpers returning 4-byte swapped-data.
swapEndian(ba.data(), ba.size());
bits = 12 + (uchar *)(ba.data());
width = header[0];
height = header[1];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment