mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-12 04:57:39 +00:00
fix png part
This commit is contained in:
@@ -58,7 +58,7 @@ void ScreenshotViewer::paint(Painter& painter) {
|
||||
}
|
||||
|
||||
// Screenshots from PNGWriter are all this size.
|
||||
if (file.size() != 232383) {
|
||||
if ((file.size() != 232383 && screen_width == 240) || (screen_width == 320 && file.size() != 463743)) {
|
||||
show_invalid();
|
||||
return;
|
||||
}
|
||||
|
@@ -80,7 +80,8 @@ Optional<File::Error> PNGWriter::create(
|
||||
png_ihdr_dyn[14] = (height >> 8) & 0xFF;
|
||||
png_ihdr_dyn[15] = height & 0xFF;
|
||||
crc.reset();
|
||||
crc.process_bytes(png_ihdr_dyn.data(), 25);
|
||||
crc.process_bytes(&png_ihdr_dyn[4], 4); // Process chunk type "IHDR"
|
||||
crc.process_bytes(&png_ihdr_dyn[8], 13); // Process chunk data
|
||||
uint32_t crci = crc.checksum();
|
||||
|
||||
png_ihdr_dyn[21] = (crci >> 24) & 0xFF;
|
||||
|
Reference in New Issue
Block a user