From 85375ee8b1e7642800becdfafb224e3a3940d49d Mon Sep 17 00:00:00 2001 From: Alcides Fonseca Date: Fri, 27 Mar 2026 01:53:15 +0000 Subject: [PATCH] Fix image demo and Image.ae native calls Rename generate_image to main in 2_image.ae so it runs as an entrypoint. Fix Image_mk and Image_open native calls to pass arguments instead of returning the Python function unapplied. Co-Authored-By: Claude Opus 4.6 --- examples/demos/2_image.ae | 2 +- libraries/Image.ae | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/demos/2_image.ae b/examples/demos/2_image.ae index dd28384b..7a0a3d85 100644 --- a/examples/demos/2_image.ae +++ b/examples/demos/2_image.ae @@ -1,7 +1,7 @@ import "Image.ae"; -def generate_image (steps:Int) : Image { +def main (steps:Int) : Image { white : Color = Color_mk 255 255 255; green : Color = Color_mk 0 255 0; image0 = Image_mk 64 64 white; diff --git a/libraries/Image.ae b/libraries/Image.ae index a1d6f8f9..0d657786 100644 --- a/libraries/Image.ae +++ b/libraries/Image.ae @@ -38,7 +38,7 @@ def Image_mk (height:{p:Int | p > 0}) (color:Color) : {i : Image | (Image_width i == width) && (Image_height i == height) } { -native "__import__('aeon.bindings.image').bindings.image.Image_mk" } +native "__import__('aeon.bindings.image').bindings.image.Image_mk(width, height, color)" } # Displays the image. # image: image to display @@ -52,7 +52,7 @@ def Image_save (image:Image) (path:String) : Unit { native "im.save(path)" } # Opens an image from a file. # path: file path # returns: loaded image -def Image_open (path:String) : Image { native "__import__('PIL.Image').Image.open" } +def Image_open (path:String) : Image { native "__import__('PIL.Image').Image.open(path)" } # Computes the mean squared error (MSE) difference between two images. # img: first image