更新SANT图像支持base64编码
This commit is contained in:
@@ -7,6 +7,7 @@ MicroPython library for the GC032A(Inherit C module)
|
||||
"""
|
||||
|
||||
import time
|
||||
import base64
|
||||
from sensor import *
|
||||
from machine import SoftI2C, Pin
|
||||
from mixgo_sant import onboard_bot
|
||||
@@ -32,3 +33,10 @@ class GC032A(Camera):
|
||||
super().display()
|
||||
else:
|
||||
super().display_stop()
|
||||
|
||||
def snapshot(self, path=None, formats=0, quality=50):
|
||||
_data = super().snapshot(path, formats=formats, quality=quality)
|
||||
if formats >= 2:
|
||||
return b'data:image/jpg;base64,' + base64.b64encode(bytes(_data))
|
||||
else:
|
||||
return _data
|
||||
|
||||
Reference in New Issue
Block a user