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')
Next success!
I decompressed guiPicData and compressed it again.
Then I created a new .GEL file with the newly compressed guiPicData and deployed it successfully to the scope.
Now we know that the Rigol decompression mechanism can handle files compressed by the 7z SDK.
This obviously doesn't mean, that it will always work but the probability is high that it does.
The next step will now be to change the Pluses, of which I still found two occurrences in the latest FW.
Thanks for the warning.
Would you want to share your concerns with us?
When you say "Somebody must look into APP." what are you referring to?