Skip to content

Commit 6de3349

Browse files
cleanups
1 parent d88966e commit 6de3349

File tree

1 file changed

+2
-11
lines changed
  • internal_filesystem/apps/com.micropythonos.imageview/assets

1 file changed

+2
-11
lines changed

internal_filesystem/apps/com.micropythonos.imageview/assets/imageview.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,10 @@ def onCreate(self):
2525
self.setContentView(screen)
2626

2727
def onResume(self, screen):
28-
#lv.libjpeg_turbo_init()
29-
#first = lv.image_decoder_t()
30-
#decoder = lv.image.decoder_get_next(first)
31-
#decoder = lv.image_decoder_t.get_next(first)
32-
#decoder.delete()
3328
self.images.clear()
3429
for item in os.listdir(self.imagedir):
3530
print(item)
36-
#if item.endswith(".jpg") or item.endswith(".jpeg"):
3731
if item.endswith(".jpg") or item.endswith(".jpeg") or item.endswith(".png"):
38-
#if item.endswith(".png"):
3932
fullname = f"{self.imagedir}/{item}"
4033
size = os.stat(fullname)[6]
4134
print(f"size: {size}")
@@ -66,14 +59,12 @@ def show_image(self, name):
6659
try:
6760
self.label.set_text(name)
6861
self.image.set_src(f"P:{name}")
69-
w = self.image.get_width()
70-
h = self.image.get_height()
71-
print(f"the LVGL image has size: {w}x{h}")
62+
print(f"the LVGL image has size: {self.image.get_width()}x{self.image.get_height()}")
7263
header = lv.image_header_t()
7364
self.image.decoder_get_info(self.image.get_src(), header)
7465
print(f"the real image has size: {header.w}x{header.h}")
7566
#image.set_size(128, 128)
7667
self.image.set_scale(512)
77-
print(f"done with show_image({name}) got {w}x{h}")
68+
print(f"after set_scale, the LVGL image has size: {self.image.get_width()}x{self.image.get_height()}")
7869
except Exception as e:
7970
print(f"show_image got exception: {e}")

0 commit comments

Comments
 (0)