We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › bad image data when loading an image error
Page Index Toggle Pages: 1
bad image data when loading an image error (Read 456 times)
bad image data when loading an image error
May 10th, 2009, 1:43am
 
Hi. New here

I am trying to follow the tutorial and can not get images to load. I tried a .jpg and .gif and they gave me an error telling me it is "bad image data". I done these so far with no luck
-Make Data folder and put my images
-Tried using the image from the tutorial "loadDisplayImage" and it worked fine  

Here is my code
Code:
//This will load an image
//error:
//"The file minty.gif contains bad image data, or may not be an image."

PImage minty;

void setup()
{
 size(200,200);
 minty = loadImage("minty.jpg");
 noLoop();
}

void draw()
{
 image(minty,0,0);
}


Thank you
Re: bad image data when loading an image error
Reply #1 - May 10th, 2009, 3:47am
 
If it works with the image from the tutorial but not your own images then it sounds like a problem with the images rather than your code.  What software are you using to save the images?

I'd try it with a couple more images downloaded from the net to confirm that it works with other images and maybe try some different image software...

Also - to be a little pedantic - if you're loading 'minty.jpg' your error message won't mention anything about 'minty.gif' Wink

Seems unlikely but just in case: Are you manually changing the extension on the image file?  That would almost certainly cause a problem...
Page Index Toggle Pages: 1