[ERROR] ImagePickerGadget.pbi (Line: 301)
[ERROR] ResizeGadget(): Maximum supported gadget height is 32767 pixels
PureBasic ImagePickerGadget() - A Cross-Platform Solution
Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
With debugger enabled you see the problem:
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Hi, this is the list of all files in directory:
Name / Extension / Size / Date / Attributes
https://pastebin.com/DnCf0aES
Name / Extension / Size / Date / Attributes
https://pastebin.com/DnCf0aES

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Thanks @HeXOR. That clearly needs a handler.HeX0R wrote: Wed Nov 27, 2024 10:43 pm With debugger enabled you see the problem:[ERROR] ImagePickerGadget.pbi (Line: 301)
[ERROR] ResizeGadget(): Maximum supported gadget height is 32767 pixels
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Thank you for that. It appears to contain over 2000 JPG and PNG images. This could be the issue, as @HeXOR had pointed out, because the expected height of the canvas to display all the images (even @120px height per image, double-columned) would exceed the 32767 canvas gadget height limitation.le_magn wrote: Wed Nov 27, 2024 11:00 pm Hi, this is the list of all files in directory:
Name / Extension / Size / Date / Attributes
https://pastebin.com/DnCf0aES
I just tested the scenario myself, and the program crashed once the canvas size exceeded 32767.
But you mentioned that the program did not crash for you? And that you are still able to scroll upwards but not downwards past a quarter of the window?
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Hi @le_magn. I've just posted an update which includes a fix that might circumvent the issue you're facing. It will now stop loading images once the canvas limitation is reached.
Barring any possibilities of implementing some form of lazy loading or paging, this would be a limitation of the gadget for now.
Please do give it a try and see if it works for you.
Barring any possibilities of implementing some form of lazy loading or paging, this would be a limitation of the gadget for now.
Please do give it a try and see if it works for you.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
yes i tried, a message popup display limit reached not all images loaded etc... but now scroll until the end and up okTI-994A wrote: Thu Nov 28, 2024 12:15 am Hi @le_magn. I've just posted an update which includes a fix that might circumvent the issue you're facing. It will now stop loading images once the canvas limitation is reached.
Barring any possibilities of implementing some form of lazy loading or paging, this would be a limitation of the gadget for now.
Please do give it a try and see if it works for you.

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Thanks for the confirmation, @le_magn. Glad to hear that.le_magn wrote: Thu Nov 28, 2024 12:43 amyes i tried, a message popup display limit reached not all images loaded etc... but now scroll until the end and up ok

I'm still working on some additional enhancements to the gadget, so please look out for updates.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Code: Select all
picker(index)\images(imgCount)\imgNum = LoadImage(#PB_Any, picker(index)\imagesFolder + DirectoryEntryName(directory))
Code: Select all
[21:49:18] [WARNING] ImagePickerGadget.pbi (Line: 312)
[21:49:18] [WARNING] The specified file does not exist.
Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Hi @AZJIO. Thanks for reporting this.AZJIO wrote: Thu Nov 28, 2024 5:51 pmCode: Select all
picker(index)\images(imgCount)\imgNum = LoadImage(#PB_Any, picker(index)\imagesFolder + DirectoryEntryName(directory))
Code: Select all
[21:49:18] [WARNING] ImagePickerGadget.pbi (Line: 312) [21:49:18] [WARNING] The specified file does not exist.
Would you be able to debug and check what file is causing that error? Because it is returned by the ExamineDirectory() routine from your input folder
This LoadImage() statement is called within a conditional block that filters through only files with the allowable image extensions. So it could possibly be a corrupted image file.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
I added "\" and it worked for me. You need to check that the path ends with "\"
Code: Select all
Debug picker(index)\imagesFolder + "\" + DirectoryEntryName(directory)
picker(index)\images(imgCount)\imgNum = LoadImage(#PB_Any, picker(index)\imagesFolder + "\" + DirectoryEntryName(directory))
Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Thanks @AZJIO.AZJIO wrote: Thu Nov 28, 2024 9:56 pm I added "\" and it worked for me. You need to check that the path ends with "\"Code: Select all
Debug picker(index)\imagesFolder + "\" + DirectoryEntryName(directory) picker(index)\images(imgCount)\imgNum = LoadImage(#PB_Any, picker(index)\imagesFolder + "\" + DirectoryEntryName(directory))
I supposed that the accuracy of the folder name should be handled by the user. PureBasic's native functions, like get temporary and current directories, return the values with the trailing path separator.
Nevertheless, it's an absolutely possible oversight, so I've added a validation for that. I'll be crediting you for this fix, btw.

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Hello again, @HeXOR. Thanks for reporting this bug. Please do note that I have credited you for this fix in the latest update.HeX0R wrote: Wed Nov 27, 2024 10:43 pm With debugger enabled you see the problem:[ERROR] ImagePickerGadget.pbi (Line: 301)
[ERROR] ResizeGadget(): Maximum supported gadget height is 32767 pixels

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
I've just posted another update to the ImagePickerGadget(). This update changes some of the earlier parameter names, and adds some new ones, in addition to a few bug fixes.
Some of the new features include:
I thank all of you who have assisted in the initial testing of this gadget, and hope to receive your continued support.
Some of the new features include:
- support for images of different sizes and orientations
- auto-rotating preview window to display portrait & landscape images
- thumbnails with options to display borders, background, and titling
- titling derived from image file names, and sized in proportion to the thumbnail
- busy notification window when loading large number of images

I thank all of you who have assisted in the initial testing of this gadget, and hope to receive your continued support.

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Wow! You've outdone yourself TI-994A!
I've not used PB in a while now but I could have really used this tool a few years back.
I quickly tested in with the free demo version of PB and was surprised that it worked. Keep up the magnificent work.

I've not used PB in a while now but I could have really used this tool a few years back.
I quickly tested in with the free demo version of PB and was surprised that it worked. Keep up the magnificent work.

Re: PureBasic ImagePickerGadget() - A Cross-Platform Solution
Hi @fromVB, and thank you for your kind words and feedback.fromVB wrote: Sat Nov 30, 2024 7:56 am Wow! You've outdone yourself TI-994A!![]()
I've not used PB in a while now but I could have really used this tool a few years back.
I quickly tested in with the free demo version of PB and was surprised that it worked. Keep up the magnificent work.![]()
I'm glad that you find it useful, even if you may not be using it.

I just checked, and you're right; it does work with the demo version of PureBasic. I didn't expect it to work, at least not on macOS, because there are some CocoaMessage() API calls used.
That's another feature then, I suppose.

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 
