Skip to content

Commit 858df97

Browse files
Default to 320x240
1 parent 5bf790e commit 858df97

File tree

1 file changed

+7
-7
lines changed
  • internal_filesystem/apps/com.micropythonos.camera/assets

1 file changed

+7
-7
lines changed

internal_filesystem/apps/com.micropythonos.camera/assets/camera_app.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CameraApp(Activity):
2121

22-
width = 240
22+
width = 320
2323
height = 240
2424

2525
# Resolution preferences
@@ -52,15 +52,15 @@ def load_resolution_preference(self):
5252
if not self.prefs:
5353
self.prefs = SharedPreferences("com.micropythonos.camera")
5454

55-
resolution_str = self.prefs.get_string("resolution", "240x240")
55+
resolution_str = self.prefs.get_string("resolution", "320x240")
5656
try:
5757
width_str, height_str = resolution_str.split('x')
5858
self.width = int(width_str)
5959
self.height = int(height_str)
6060
print(f"Camera resolution loaded: {self.width}x{self.height}")
6161
except Exception as e:
62-
print(f"Error parsing resolution '{resolution_str}': {e}, using default 240x240")
63-
self.width = 240
62+
print(f"Error parsing resolution '{resolution_str}': {e}, using default 320x240")
63+
self.width = 320
6464
self.height = 240
6565

6666
def onCreate(self):
@@ -356,7 +356,7 @@ def try_capture(self, event):
356356

357357

358358
# Non-class functions:
359-
def init_internal_cam(width=240, height=240):
359+
def init_internal_cam(width=320, height=240):
360360
"""Initialize internal camera with specified resolution."""
361361
try:
362362
from camera import Camera, GrabMode, PixelFormat, FrameSize, GainCeiling
@@ -383,7 +383,7 @@ def init_internal_cam(width=240, height=240):
383383
(1920, 1080): FrameSize.FHD,
384384
}
385385

386-
frame_size = resolution_map.get((width, height), FrameSize.R240X240)
386+
frame_size = resolution_map.get((width, height), FrameSize.QVGA)
387387
print(f"init_internal_cam: Using FrameSize for {width}x{height}")
388388

389389
cam = Camera(
@@ -470,7 +470,7 @@ class CameraSettingsActivity(Activity):
470470
def onCreate(self):
471471
# Load preferences
472472
prefs = SharedPreferences("com.micropythonos.camera")
473-
self.current_resolution = prefs.get_string("resolution", "240x240")
473+
self.current_resolution = prefs.get_string("resolution", "320x240")
474474

475475
# Create main screen
476476
screen = lv.obj()

0 commit comments

Comments
 (0)