Page 1 of 1
Image object not initalized
Posted: Sun Oct 22, 2006 1:08 am
by PB
If you run this code (with a valid path to a JPG image) then you get an error
of "Image object not initalized" for the Debug line. This is correct, because
the JPG couldn't be decoded. I know that I should be using "If LoadImage..."
for it. But my suggestion would be that perhaps the error should say that the
UseJPEGImageDecoder() command should be called before loading a JPG?
Code: Select all
LoadImage(0,"Image.jpg")
Debug ImageWidth(0)
Posted: Sun Oct 22, 2006 5:55 am
by Intrigued
I agree, I ran some code that does rotates an image from the forum here tonight and I saw this error.
The adjustment would help us remember and those new to PB to clue in on the problem, quickly.
(chuckling)
I actually first tried:
lmao
Posted: Sun Oct 22, 2006 8:54 am
by PB
> I agree, I ran some code that does rotates an image from the forum here
> tonight and I saw this error
Hehe, that's the code I ran to get this error!

Great minds think alike.
Posted: Sun Oct 22, 2006 10:43 am
by walker
May the answers from Fred & Freak in this post help?
http://www.purebasic.fr/english/viewtop ... =loadimage
This behavior is an intended ....
Re: Image object not initalized
Posted: Sun Oct 22, 2006 10:46 am
by Trond
PB wrote:
for it. But my suggestion would be that perhaps the error should say that the
UseJPEGImageDecoder() command should be called before loading a JPG?
If the JPEG decoder isn't included then the JPEG file signature (at the start) will be unknown and the file will look corrupted. So that would be a bit difficult, since the whole point with the dynamically added decoders is that the program doesn't know about the other file formats at all until the correct decoder is added.
Posted: Mon Oct 23, 2006 12:44 am
by Intrigued
Without having these decoders in by default then the program itself can be smaller in size, that seems to be why other formats outside of .bmp where not included by default.