From 691b64d192ec0daf0e5cec9ed487a0dd842f16d7 Mon Sep 17 00:00:00 2001 From: Jelmer Date: Sun, 1 Dec 2024 11:34:50 +0100 Subject: [PATCH] fixed the lut argument for g5-compressed images --- ESP32_AP-Flasher/src/newproto.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ESP32_AP-Flasher/src/newproto.cpp b/ESP32_AP-Flasher/src/newproto.cpp index 9fd3cb3d..b49f9901 100644 --- a/ESP32_AP-Flasher/src/newproto.cpp +++ b/ESP32_AP-Flasher/src/newproto.cpp @@ -274,6 +274,8 @@ void prepareExternalDataAvail(struct pendingData* pending, IPAddress remoteIP) { case DATATYPE_IMG_ZLIB: case DATATYPE_IMG_RAW_1BPP: case DATATYPE_IMG_RAW_2BPP: + case DATATYPE_IMG_G5_1BPP: + case DATATYPE_IMG_G5_2BPP: case DATATYPE_IMG_RAW_3BPP: { char hexmac[17]; mac2hex(pending->targetMac, hexmac); @@ -446,7 +448,7 @@ void processXferComplete(struct espXferComplete* xfc, bool local) { contentFS->remove(dst_path); } if (contentFS->exists(queueItem->filename)) { - if (config.preview && (queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_ZLIB)) { + if (config.preview && (queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_G5_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_G5_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_ZLIB)) { contentFS->rename(queueItem->filename, String(dst_path)); } else { if (queueItem->pendingdata.availdatainfo.dataType != DATATYPE_FW_UPDATE) contentFS->remove(queueItem->filename); @@ -967,7 +969,7 @@ bool queueDataAvail(struct pendingData* pending, bool local) { } newPending.len = taginfo->len; - if ((pending->availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || pending->availdatainfo.dataType == DATATYPE_IMG_ZLIB) && (pending->availdatainfo.dataTypeArgument & 0xF8) == 0x00) { + if ((pending->availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || pending->availdatainfo.dataType == DATATYPE_IMG_ZLIB || pending->availdatainfo.dataType == DATATYPE_IMG_G5_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_G5_2BPP) && (pending->availdatainfo.dataTypeArgument & 0xF8) == 0x00) { // in case of an image (no preload), remove already queued images pendingQueue.erase(std::remove_if(pendingQueue.begin(), pendingQueue.end(), [pending](const PendingItem& item) {