Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:05 28 Jul 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMBasic: soliciting syntax suggestions for fun/cmd to read image size

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4380
Posted: 12:12am 28 Jul 2026
Copy link to clipboard 
Print this post

Hi folks,

I find myself wanting to add support to MMB4L to get the width and height of an image file - png in particular.

I have two ideas for syntax, either a function:

size% = MM.INFO(IMAGE SIZE filename$)


Which returns width and height in the lower and upper words respectively of the 64-bit size% variable.

Or a command:

IMAGE GETSIZE filename$, width%, height%


Where width% and height% are filled on return (act as pass by reference variables) - I have used the same pattern previously due the CONSOLE GETSIZE command.

In both cases I was proposing to determine the image type from the file extension.

Any suggestions?

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
EDNEDN
Guru

Joined: 18/02/2023
Location: United States
Posts: 303
Posted: 02:52am 28 Jul 2026
Copy link to clipboard 
Print this post

MM.Info() would be a more natural and consistent fit in my opinion.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026