Loadsprite load failures

Previous topic - Next topic

geekpeter

hey there, im testing making apps of interest to myself atm as a means of learning my way around GLBasic, all seems well so far, with my apps working fine on android/windows/webOS etc, however my current app pulls images from the web to use as a thumbnail picture and i lay some text/spiel inside the thumbnail at the bottom.

All seems normal so far, however after a while i noticed i started getting the following messages in the debug window....

*** Unhandled exception ***
   EXCEPTION_ACCESS_VIOLATION

after much testing i found that gif images gave me such an error so i just blocked gif's being loaded for now, however my issue now is with some jpg files, nearly all of them work but the odd one pings the above error whenever LOADSPRITE attempts to load them and i crash immediatly.  (loading the offending image into gimp and resaving as png or jpg fixes the issue but isnt a solution, it only helps confirm the problem)

is there any way around this given that im trying to load images out of my control on the web?  if not is there a way to somehow trap the error so i can load an alternative locally stored image because atm im kind of stuck with a fatal crash, if i cant find a way around this i'll likely have to dump the thumbnail idea and make a text based scrolly menu instead of pictoral thumbnails which is a bit rubbish.

cheers for any help.

spacefractal

#1
gif is not supported and is propterty newer do. Not even 256 colors pngs is supported (those which im grayed have failed too).

But no big deal, you should use bmp, png or jpg formats. png is best if you use a lots of transperancy, jpg is great for backgrounds with no transperancy, and also bmp is good for other areas. Yes bmp can been big in filesize, but can been compressed very well...

Howover there is a external gif loader in the code snippet..... Search for that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

fuzzy70

#2
The jpg problem might be caused with them being of the "progressive" type. Will have a look when back home to see if that type gives problems.

That type was designed for the web as to get a picture up ASAP while the page was still loading & as far as I'm aware it was only really used for that purpose.

Lee

Edit: Well it's not progessive jpg's that cause a problem as just tested them & load fine. So am at a loss over the jpg issue sorry.

Sent from my HTC Wildfire using Tapatalk 2
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

geekpeter

cheers anyways lads, ill have to work around the problem somehow.

kanonet

Could be interessting if you could give a bit more details about that failing jpgs.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

geekpeter

out of interest heres one of the images thats crashing GLBasic LOADSPRITE and LOADBMP.

http://cdn.mangaeden.com/mangasimg/be/be53c906900ce0e55b92900c9da3b3c5fee0b604e0612a56c2862062.jpg

my app made at request of my cousin and myself is a sort of "do allsorts" e-reader, so far ive got it to pull content/images from

Locally stored .txt books (sticking to plain text books atm)
CTRL+ALT+DELETE Online Comic book
Manga Eden
MangaFox
Eric Schwartz - Sabrina Online (Pulls images but their all gif and no worky, found the a/m thread on loading gif images thanks spacefractal)
Cyanide and Happiness

currently working and failing at also importing news from the BBC website.  (fix it eventually)

plan is tho to import all info required from whichever selected source but lay them out exactly the same in thumbnail form which i can browse through, i can type away and the search is currently made on the fly and updates near immediatly.  i DID originally build a local archive of all thumbnails required but this ended up being rather immense, so now thumbnails are loaded and saved locally as and when required.

if i cant load or at least handle via error trapping whatever images may be out there (as im not using my own but retrieving other peoples) ill have to reformat the whole thing in text or something without a thumbnail (which i like tbh, looks nice).

long story short, the above jpg link is ONE of several crashing my app, can anyone see anything wrong with it as it works/shows fine on my desktop pc's.

geekpeter

if the above image is of no use i could perhaps make a collection of other failing jpgs and maybe find a common denominator somewhere, just means searching through a large collection of search results till the app crashes.

fuzzy70

#7
The Image you linked earlier is an 8bit greyscale Jpg rather than 24bit which might be the reason for the failure. Might be a problem with the jpg library used in GLB in that it does not support that format.

Lee

EDIT: I can confirm that being an 8bit Greyscale jpg is what the problem is. A jpg that loaded fine before failed when I converted & saved it to that format in Photoshop.
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

geekpeter

Fingers crossed theres a fix for that 1 day, im glad im not the only one able to crash via the image, i was dreading others having no issue and it being just me, till the day it may be fixed i think i will have to abort the image thumbnail loading idea and think of a Plan B for now, my only other hope was that maybe error trapping could have caught the problem and i could have loaded my local "no-image.png" which substitutes for missing images and gif's until i adopt the aforementioned gif loader.

thanks for checking for me tho fuzzy70.

fuzzy70

No problems.

TBH greyscale JPG's are not really common as people tend to use png/gif for images that have a palette of 256 colours or less as using a lossy compression like jpg on such images is not ideal.

How are you getting the images from the web (please excuse my ignorance on this matter but have never done any web related stuff in a programming sense other than HTML & some basic actionscript). I only ask as the jpg file header should be pretty standard & you should be able to read that to determine what type of jpg it is, if it's a greyscale one then skip loading it.

I know the above would work on a non web device as you just do an openfile & read what you need, but like I said I have zero experience on the web commands & if that's possible.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

spacefractal

also indexed pngs also not Work, so its seen glbasic only like full color images. For games, this is not big deal, but its can been a breaker for a more serious software, like ereader.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

geekpeter

@ fuzzy70

To aquire images im using API's where available which are typically a downloadable json file which i use to aquire all the information required such as book/comic/news titles/thumbnails/links etc which i pull using NETWEBGET

example, to aquire the mangaeden index json im using

Code (glbasic) Select
NETWEBGET ("www.mangaeden.com","/api/list/0/",80,"m-index")

here is a snippet from the mangaeden json index
Code (glbasic) Select
    {
      "i": "4e70e91ac092255ef70016c2",
      "a": "the-legend-of-zelda---wind-waker---links-log-book",
      "im": "cb/cbcad61f55f4e00cd44e9e21d50b43bbc1967b868ff27ff8e7fb4db5.jpg",
      "t": "The Legend of Zelda - Wind Waker - Links Log Book"
    },


the huge index yields all the information required, its saved locally, I then OPENFILE and READLINE all the information required into an array, its all terribly easy as all the information and links are provided, however sites like the BBC site which have an API to use should be exactly the same as the above JSON file, but the json files im recieving from them dont seem to have any EOL and their files are all a giant mess of text seen here.

here is an extract/example of what should be retrieved from a bbc news api/json file, which again is aquired via NETWEBGET
Code (glbasic) Select
NETWEBGET ("api.bbcnews.appengine.co.uk","/stories/uk",80,"bbc-index")

the following should be how the file is formatted

Code (glbasic) Select
            "title": "Crash pilot was 'highly skilled'",
            "description": "Tributes are paid to a pilot who died when a helicopter crashed into a crane in London, as police name a second person killed on the ground.",
            "link": "http://www.bbc.co.uk/news/uk-england-london-21049125#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa",
            "published": 1358374781,
            "thumbnail": "http://news.bbcimg.co.uk/media/images/65335000/jpg/_65335893_65332615.jpg"


instead their file ends up like this http://api.bbcnews.appengine.co.uk/stories/uk which is a colossal mess ¬ ¬

if no API's are provided for what i need then im just doing it the hard way and just using NETWEBGET to aquire raw index.html type files and pruning all the junk html and just extracting images/links i need to the information i need that way.

Heres 2 snapshots of my app sorting its thumbnails out into 2 different device resolutions and trying to make best use of all the screenspace possible, examples are from my pre3 and touchpad, thats 480x800 and 1024x768.

https://www.dropbox.com/s/t5uyudvgj38uvqk/PRE3-ScreenShot.png
https://www.dropbox.com/s/o9w99znnaoxmbfz/Touchpad-ScreenShot.png

However im a tad confused on the android side atm, currently scouring the forums for fixes etc, my builds "were" working on my android device which has an identical resolution to my pre3, but for some reason it was displaying 2 columns, 4 rows instead of the 3 columns, 4 rows my pre3 does (which is what i intended) so i think maybe something is going wrong when im trying to aquire device resolutions.

Also for some reason my app now only shows a blank white screen on my android device, i CAN see the thumbnails when their being downloaded fresh, when the system pauses while NETWEBGET aquires the thumbnails i see the screen, however once the whole screen finishes updating and nothing more needs loading everything goes white/blank and im not too sure why.

geekpeter

@ spacefractal

oh i havent had a png crash on me yet but ill remember thats also a possability, and yeah GLBasic is ofc intended for games and im currently ofc also making a game, its just that i often like little side projects to help learn new tricks/tips or just useful things in general and a multisource web based ereader seemed like a good indepth project to attempt.

ive seen a forum thread with a decent virtual keyboard, but again i though that would be a good thing to learn for myself as ive never tried such a thing before and its also something im making from scratch so ive got several things going on and ideas in my head, and trying to build these things helps me find what unexpected limitations GLBasic has and how to work around them.

and cheers for the help/future help when/if i ask more dumb questions.