After hacking something together with notepad I get all images from latest update:
I put this file and guiPicData to somewhere and double click on ***.py and get RAW data.
This is making for me BAT file too with ffmpg convert command lines. I add to this directory
ffmpeg.exe and all required DLL files for this. You can change "ffmpeg" with something else.
PNG can changed too to something else if other parameters corrected too.
Double click on BAT is making next miracle...
import os
src_file = 'guiPicData' #code.py and this file with data must be in the same directory
path = 'images' #it makes new directory
if not os.path.exists(path):
os.makedirs(path)
src_file_size = os.path.getsize(src_file)
b = bytearray(open(src_file, 'rb').read())
pos = 0
nr = 0
while pos < src_file_size:
x = b[pos:pos+2]
y = b[pos+2:pos+4]
num1 = int.from_bytes(x, byteorder='little', signed=False)
num2 = int.from_bytes(y, byteorder='little', signed=False)
length = num1 * num2 * 2
data = b[pos+4:pos+4+length]
pos +=4+length
nr +=1
print (length, num1, num2, pos) # for test and feedback
output = "file_%03d_%dx%d" % (nr, num1, num2)
open(os.path.join(path, output), 'wb').write(data)
text = "ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s %dx%d -i %s -f image2 -vcodec png %s.png" % (num1, num2, output, output)
# output = "file_%03d_%dx%d.bat" % (nr, num1, num2) # uncomment if you want bat file for each RAW image
# open(output, 'w').write(text) # uncomment if you want bat file for each RAW image
with open(os.path.join(path, "test.bat"), "a") as myfile:
myfile.write(text+ '\n')
All images are in zip here too: