mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-04-12 04:42:44 -04:00
Fixed excessively frequent warning messages
This commit is contained in:
@ -1080,6 +1080,7 @@ QByteArray BODYChunk::deinterleave(const QByteArray &planes, qint32 y, const BMH
|
|||||||
// (red and green modify operations are unavailable)
|
// (red and green modify operations are unavailable)
|
||||||
auto ctlbits = bitplanes > 5 ? 2 : 1;
|
auto ctlbits = bitplanes > 5 ? 2 : 1;
|
||||||
auto max = (1 << (bitplanes - ctlbits)) - 1;
|
auto max = (1 << (bitplanes - ctlbits)) - 1;
|
||||||
|
auto wrongIdx = false;
|
||||||
quint8 prev[3] = {};
|
quint8 prev[3] = {};
|
||||||
for (qint32 i = 0, cnt = 0; i < rowLen; ++i) {
|
for (qint32 i = 0, cnt = 0; i < rowLen; ++i) {
|
||||||
for (qint32 j = 0; j < 8; ++j, ++cnt) {
|
for (qint32 j = 0; j < 8; ++j, ++cnt) {
|
||||||
@ -1111,7 +1112,7 @@ QByteArray BODYChunk::deinterleave(const QByteArray &planes, qint32 y, const BMH
|
|||||||
prev[1] = qGreen(pal.at(idx));
|
prev[1] = qGreen(pal.at(idx));
|
||||||
prev[2] = qBlue(pal.at(idx));
|
prev[2] = qBlue(pal.at(idx));
|
||||||
} else {
|
} else {
|
||||||
qCWarning(LOG_IFFPLUGIN) << "BODYChunk::deinterleave(): palette index" << idx << "is out of range";
|
wrongIdx = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1121,6 +1122,9 @@ QByteArray BODYChunk::deinterleave(const QByteArray &planes, qint32 y, const BMH
|
|||||||
ba[cnt3 + 2] = char(prev[2]);
|
ba[cnt3 + 2] = char(prev[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (wrongIdx) {
|
||||||
|
qCWarning(LOG_IFFPLUGIN) << "BODYChunk::deinterleave(): HAM palette index out of range!";
|
||||||
|
}
|
||||||
} else if ((modeId & CAMGChunk::ModeId::HalfBrite) && (cmap) &&
|
} else if ((modeId & CAMGChunk::ModeId::HalfBrite) && (cmap) &&
|
||||||
(bitplanes >= BITPLANES_HALFBRIDE_MIN && bitplanes <= BITPLANES_HALFBRIDE_MAX)) {
|
(bitplanes >= BITPLANES_HALFBRIDE_MIN && bitplanes <= BITPLANES_HALFBRIDE_MAX)) {
|
||||||
// From A Quick Introduction to IFF.txt:
|
// From A Quick Introduction to IFF.txt:
|
||||||
@ -1133,6 +1137,7 @@ QByteArray BODYChunk::deinterleave(const QByteArray &planes, qint32 y, const BMH
|
|||||||
// absolute colors.
|
// absolute colors.
|
||||||
ba = QByteArray(rowLen * 8, char());
|
ba = QByteArray(rowLen * 8, char());
|
||||||
auto palSize = cmap->count();
|
auto palSize = cmap->count();
|
||||||
|
auto wrongIdx = false;
|
||||||
for (qint32 i = 0, cnt = 0; i < rowLen; ++i) {
|
for (qint32 i = 0, cnt = 0; i < rowLen; ++i) {
|
||||||
for (qint32 j = 0; j < 8; ++j, ++cnt) {
|
for (qint32 j = 0; j < 8; ++j, ++cnt) {
|
||||||
quint8 idx = 0, ctl = 0;
|
quint8 idx = 0, ctl = 0;
|
||||||
@ -1147,10 +1152,13 @@ QByteArray BODYChunk::deinterleave(const QByteArray &planes, qint32 y, const BMH
|
|||||||
if (idx < palSize) {
|
if (idx < palSize) {
|
||||||
ba[cnt] = ctl ? idx + palSize : idx;
|
ba[cnt] = ctl ? idx + palSize : idx;
|
||||||
} else {
|
} else {
|
||||||
qCWarning(LOG_IFFPLUGIN) << "BODYChunk::deinterleave(): palette index" << idx << "is out of range";
|
wrongIdx = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (wrongIdx) {
|
||||||
|
qCWarning(LOG_IFFPLUGIN) << "BODYChunk::deinterleave(): HalfBrite palette index out of range!";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// From A Quick Introduction to IFF.txt:
|
// From A Quick Introduction to IFF.txt:
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user