mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
fix(installer): 更新安装程序版本至0.3.7 Beta 9
docs(help): 更新about.hlp中的网站链接至新域名 refactor(help): 优化pkg_download_en.hlp的代码块显示格式 feat(imageview): 添加图像加载错误提示和注释说明 style(time): 修复帮助文档格式错误 feat(shell): 添加欢迎界面图形显示 test: 新增imageview和help文档的测试程序
This commit is contained in:
34
data/computercraft/lua/rom/programs/test_imageview.lua
Normal file
34
data/computercraft/lua/rom/programs/test_imageview.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
-- test_imageview.lua: Test the imageview command
|
||||
local shell = require("shell")
|
||||
|
||||
print("=== Image Viewer Test ===")
|
||||
print("Note: This program uses the paintutils library for image handling,")
|
||||
print(" not an 'image' API. CC Tweaked doesn't have an 'image' API.")
|
||||
print("")
|
||||
print("Testing imageview command with a sample image...")
|
||||
print("This will attempt to load a test image from the internet.")
|
||||
print("Press Ctrl+T to stop the test if needed.")
|
||||
print("\nNote: You need an internet connection for this test.")
|
||||
print("\n3...")
|
||||
os.sleep(1)
|
||||
print("2...")
|
||||
os.sleep(1)
|
||||
print("1...")
|
||||
os.sleep(1)
|
||||
|
||||
-- Use a sample image URL that's known to work
|
||||
local testImageUrl = "http://time.syiban.com/img/xcx.png"
|
||||
|
||||
-- Execute the imageview command with the test URL
|
||||
local success, errorMsg = shell.execute("imageview " .. testImageUrl)
|
||||
|
||||
if success then
|
||||
print("\nTest completed successfully.")
|
||||
print("The image viewer is working correctly with paintutils.")
|
||||
else
|
||||
print("\nTest failed: " .. errorMsg)
|
||||
print("Make sure you have internet access and the URL is valid.")
|
||||
end
|
||||
|
||||
print("\nTest finished. Press any key to return.")
|
||||
os.pullEvent("key")
|
||||
Reference in New Issue
Block a user