Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 6th Oct 2010 23:50
Hi evry time i try to load an image by using the comand load image I get this error



Srry about my english im from sweeden
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2010 00:04
Post your code

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Oct 2010 08:37
make sure the path to the image file is correct. If your image is in "media\an_image.bmp" then it should look like:



TheComet

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 7th Oct 2010 08:49 Edited at: 7th Oct 2010 08:50
That's exactly how i wrote it. If I load an image with load image "filepath",imagenumber it crashes

Srry about my english im from sweeden
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 7th Oct 2010 11:34 Edited at: 7th Oct 2010 11:37
Seriously, triple verify that an image exists at whatever location you're pointing to. make sure that the path either starts with a drive name (IE a full path), or the path starts in the directory your project is in (relative path). When you run code that ISN'T in a project, and you say 'load image "blargh.bmp",1', since that code is compiled to the DBPro temp directory (there's nowhere else for it to go), all the file paths are relative to the temp directory.

[edit]
the reason ppl have no clue how to help you is that you've basically said:
"I have a problem"
ppl: "Have you tried this?"
"Nope i'm doin it right"

Also, what type of file is the image? Can you load it in MS Paint? It might be a corrupt file or an unsupported image format. More likely than not - you're trying to load a file that doesn't exist (IE WRONG DIRECTORY!)

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Oct 2010 12:37 Edited at: 7th Oct 2010 12:37
Yeah, you need to give us more information if you want us to be able to help you.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th Oct 2010 13:30
"filepath" is relative to the place where your .DBA is. You have to save your code first to be able to locate files.
Frank C
16
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 7th Oct 2010 14:30
DBPro editor is really bad about how it saves projects by default, more than likely the editor is telling the compiler that the project is in your Temp directory where it has a copy that your working from. Make sure you save the Project then reopen it from the location you saved it at.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2010 14:36
...post your code?

Nobody here is psychic and you might be surprised to find there's a really obvious (to everyone but you) error.

It always helps...

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 7th Oct 2010 17:30
Here is the code



Srry about my english im from sweeden
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Oct 2010 17:40
It may be better to post the entire project directory.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 7th Oct 2010 17:41
try using the back slash in the file path instead of fwd slash i.e

Load image "3d\test.tga",1

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2010 17:46 Edited at: 7th Oct 2010 17:47
OK, The code seems fine.

1-Does the file definitely exist in the correct relative path to where the "exe" is produced (you haven't answered this previously)? For example you have an image in a folder called "3d", is that right?

2-Is the image corrupt? Post the image and I'll test it

EDIT: Baxslashes are treated the same as forwardslashes when loading files

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Oct 2010 17:48
Quote: "It may be better to post the entire project directory."


Yes - but not the whole Project folder please, just the folder for that particular project. Zip it and post it. Then we'll all be able to see what the problem is.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th Oct 2010 18:19
Ok, take a look at your project folder. Does the directory 3d appear in there? So, you should have your exe and program code alongside your folder called 3d, which includes the file test.tga.
An easy way to check is simply call dir, from within your program and see what files come up. It really sounds like it is working from a different directory to me, and everyone else by the looks! Just make sure the files are exactly where they should be in relation to your code.
Also, and this can be a severe pain in the rear end, sometimes if you copy files across to the standard project folder when using win 7/vista systems say from your art package directly. It saves them, you can see them within the program. Look in explorer or in DB though and the files do not appear. You have to physically copy them across into the folder manually. Best bet imo is to make a folder other than the standard one, on the c drive called DBprojects or such and use that for projects. Cuts out a lot of admin/security nonsense.

http://s6.bitefight.org/c.php?uid=103081
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 7th Oct 2010 18:26
All good advice to you Zoq2, but you have to do something to get help.

Also if you go to the folder where your "test.tga" file is, right click on it, click properties, and copy the location and paste that location in full here, we may be able to eliminate possible problems.

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 7th Oct 2010 19:33
I have tested the code in many places and with many images

Srry about my english im from sweeden
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2010 21:38
Then you are obviously not doing anything wrong... it must be the software.

However, unless you can provide a working example of your problem it will never get fixed!!

Upload your whole folder for this problem or make a smaller project that does the same thing and upload that. People here will get sick of trying to help someone who won't do what they ask in order to help! I know I am.

Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 7th Oct 2010 21:54
Have you tried using an absolute path starting from the drive letter, just for the sake of seeing if it will work?


When I run test code and want to save or load something, I always use the root of the C: drive just for simplicities sake.

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 8th Oct 2010 00:02
Ok here is a simle project

Srry about my english im from sweeden
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Oct 2010 01:29 Edited at: 8th Oct 2010 01:30
And there's your problem: there's no such '3d' folder, the file is located in the root folder.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Oct 2010 03:24
Quote: "The Zoq2"


Benjamin is right. Painfully so in fact. Several people told you where the image file had to be - and DVader even spelt it out for you:

Quote: "Ok, take a look at your project folder. Does the directory 3d appear in there? So, you should have your exe and program code alongside your folder called 3d, which includes the file test.tga.
"


Did you you bother to read what people were telling you? If you don't know what a folder is then perhaps you should be posting on the Newcomers DBPro Corner board rather than here. People get rather annoyed on this board when someone doesn't follow the advice they've been given - in this case several times over.
The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 8th Oct 2010 08:50
Yes but i was so sure that i didn't write the 3d/ in the code because i have gor this error on so many othere places were the filepath have been right(i think)

Srry guys but thanks for the help!

Srry about my english im from sweeden
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Oct 2010 10:47
[facepalm]

Rule #1 [baxslash book of programming rules V1.0]:Always assume that you have done something wrong.

I find it's almost always a mistake on my part and if I start under that assumption I don't look so bad when it turns out I'm right.



TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Oct 2010 13:47
The first thing I said,

Quote: "make sure the path to the image file is correct."


and you didn't do it...


Anyway, glad it got fixed, in the future try to listen to what people say, and assume you did it wrong until you proved you did it right.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Oct 2010 13:51
Quote: "Yes but i was so sure that i didn't write the 3d/ in the code"


Don't worry. We all make daft errors like that from time to time. We "know" what we typed - so we don't bother to check that we did.

Glad it's all sorted anyway. Hopefully you'll be able to make good progress now.

Login to post a reply

Server time is: 2026-07-22 03:51:45
Your offset time is: 2026-07-22 03:51:45