GLBasic forum

Main forum => Bug Reports => Topic started by: spacefractal on 2012-Apr-29

Title: SETSHOEBOX not working correctly.... {was missing command feature}
Post by: spacefractal on 2012-Apr-29
today I have trouble to get that command to work, becuase I have no clue its have open the shoebox file or not.

I did that:

- I have a Media/gpx folder that contain all graphics.
- I shoebox that graphics folder and give the result as Media/gpx.sbx.
- I rename the Media/gpx folder to make sure its use the showbox (as testing).
- I trying to set it with SETSHOEBOX "gpx.sbx", "gpx.sbx", but no path, because its allready is open in the Media folder.

When I so LOADSPRITE or such mean, then its failed.

I have also subfolder with some medias (no filename use same name, since I are aware of subfolders not supported) and path using is the same (which its should have removed anyway). But I do more concern how to check, if the SHOEBOX really have been set or I have used some sort wrong path or something with that. So its would been nice its its could return a error as well STOUT which path/file$ its tried to open. Then its would been much easier to debug.

So its might not been a bug in SETSHOWBOX directly itself, but more I want some more ERROR info what its tried.


Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-Apr-29
What platform are you using ?  It works fine with  Windows, Linux and Android,  and should work on alll other platforms too
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: Ian Price on 2012-Apr-29
Also works fine on webOS, Wiz and Pandora.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-Apr-29
windows 7.

I pretty sure it's somewhere path issue or filename issue, but I just want some error report if path not exits or file found. Pretty sure it's a somewhere path issue and I just see what it's try to open.

I just wonder what it's happens here and why it's won't open....
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-Apr-29
Yes, I did mention that it would be nice if DOESFILEEXIST could be used with Shoebox files : http://www.glbasic.com/forum/index.php?topic=5465.msg42816#msg42816
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: Kitty Hello on 2012-Apr-30
In debug mode it should complain. No?
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: matchy on 2012-Apr-30
I recently tried using the shoebox win Win32 and I had troubles also.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-Apr-30
its look like SETSHOWBOX simply just fail to open the file, but no error report happens, so hard to tell why.

Try again later if I got something using debug (neary allways on, but mean I have never seen a output.

I pretty sure its somewhere a path, filename and/or formatting issue that is not correct (etc I use / and not \), and I have no spaces in directories.

Its mightbeen happens recentely as well. So later I try to cleanup the project (could been cool to possible clean up the temp directly from IDE) and see what happens.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-Apr-30
Perhaps you are trying it with a format SHOEBOX wont deal with - JPEGs for example
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-Apr-30
its dosent open SHOEBOX at all, elsewise I would notice if jpg was missing (only floor in Greedy Mouse is jpg format, rest is in png format). By now I juts use scrampled file by now.

Still not tested why its not open the file, what its really tried due no debug about it.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-Apr-30
What platform are you trying it on ?
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-Apr-30
allready wrote that, 64bit Windows 7 and on D: drive.

I invistate later today or tomorrow owhat really happens (im not time yet to checkout). Im still pretty sure is a path issue or some sort of that. I'm not using SHOEBOX at the top, but more when a graphics is loaded. But I did tried to the top without succes.

I'm pretty sure when its first got it open the SHOEBOX file, its would run as its should (even with missing jpg, its a minor thing).
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-May-01
I cleaned the project (emptied %TEMP% folder) and tried again. Its still not open it and all files returned 0 with GETFILESIZE, so its still seen its not have open it at all.

I have tried both relative as well fullpath, and even tried something like this without sucess:

SETSHOEBOX "d:/gpx.sbx","d:/gpx.sbx" (as well only used DATA argument).

So I must say I cant get shoebox files to work on Win32 64bit. Still not tested same happens on other platforms.

Howover its try to open jpg files first, when its a aware bug, but its does on png files at well. Nothing is open at all.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: Minion on 2012-May-01
Just a quick question, did you "shoebox" the Media folder or the Media/gpx folder, or no folder at all ? Are you including the folder names in the path to the shoebox ? Is the shoebox in the media files (if you have SETCURRENTDIR("Media") ... or whatever folder you are using) ?
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-May-01
QuoteIts still not open it and all files returned 0 with GETFILESIZE
Then the file doesn't exist or you are looking for the wrong file...

This works perfectly well with my Windows 7 x64 :

Code (glbasic) Select
DEBUG "File Exist : "+DOESFILEEXIST("Media/Media.sbx")+"\n"
SETSHOEBOX "Media/Media.sbx","Media/Media.sbx"
LOADSPRITE "untitled.jpg",0
LOADSPRITE "untitled.png",1
SETSHOEBOX "",""
DRAWSPRITE 0,0,0
DRAWSPRITE 1,256,256
SHOWSCREEN
KEYWAIT


It doesn't show the JPEG file, but it does with the PNG file

I've included my project so you can try that one.

[attachment deleted by admin]
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-May-01
I found what it happens, and its a glbasic bug.

Its happens when you use it together with GENSPRITE(), then its will fail to open the file. There is nothing wrong with SETSHOEBOX its self, but its more LOADSPRITE and other commands that use it.

Here is the code that fail to work:

Code (glbasic) Select

DEBUG "File Exist : "+DOESFILEEXIST("Media/gpx.sbx")+"\n"
SETSHOEBOX "Media/gpx.sbx","Media/gpx.sbx"
LOCAL a=GENSPRITE() // <- that trick the bug.
LOADSPRITE "gffd/untitled.jpg",0
LOADSPRITE "fhjjfcb/untitled.png",a
SETSHOEBOX "",""
DRAWSPRITE 0,0,0
DRAWSPRITE 1,256,256
SHOWSCREEN
KEYWAIT


Greedy Mouse is heavy based on GENSPRITE(), so that is why its failed to get working correctly with SETSHOEBOX.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-May-01
There is a slight problem with your code.  As today's exercise, I'll let you find out why nothing is being display.  Will give you one clue though : GENSPRITE values don't start at 0 :)
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-May-01
yes there was a spelling, ups =D, but its still not work in Greedy Mouse as excepted. Its can open fine (images shown) directly, but still not when using them using regular code. Strange. Its might been somewhere SETCURRENTDIR issue or something like that (even SHOEBOX is open fine and keeps that before using that command). I look future what happens.

But somethings more compliced.
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: spacefractal on 2012-May-01
here is a screenshot: (yes the REPLACE part is a bit messy, but irrerevent here).

I'm are not trying to load a file here in this test, only trying get thier GETFILESIZE (jpg should fail, not png):
(http://dl.dropbox.com/u/3236515/GreedyMouse/strangeshoebox.png)

EDIT: I did not shown the full path on the second Explore, buts its was correct. Graphics folder was renamed after the shoebox test.

EDIT2: I'm still not 100% sure what happens (its NOT GETSPRITE(), its was a silly mistake, hehe), but something other conflict).
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: MrTAToad on 2012-May-01
I don't think GETFILESIZE works with shoeboxed files...
Title: Re: SETSHOEBOX not working correctly.... (no error info)
Post by: Slydog on 2012-May-01
Could you just use 'DOESFILEEXIST()' instead?
It looks like you're just checking to see if the file exists by seeing if the size is > 0.
Title: Re: SETSHOEBOX not working correctly.... {was missing command feature}
Post by: spacefractal on 2012-May-01
its that.

its GETFILESIZE(), which I meants its have works before (but was long time ago), also DOESFILEEXISTS() not either. And yes I just used GETFILESIZE() for file exists check, since I first noticed doesfileexists recently, propterty because both do the same job really (what I used them for here).

So its turned to just been a missing feature, not a bug.

Sorry if I sound negative og aggresive, that was never intendend, but also thanks for all help.

Its now 100% totally to Gernot if he want to add those missing features to v11  :).

EDIT: Renamed to more precision title.
Title: Re: SETSHOEBOX not working correctly.... {was missing command feature}
Post by: MrTAToad on 2012-May-03
Yes, DOESFILEEXIST doesn't work with Shoeboxes :)

If you want to make sure a sprite has loaded, check it's size...  If it's 0 then there was a problem...