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 › original image dimension
Page Index Toggle Pages: 1
original image dimension? (Read 467 times)
original image dimension?
May 9th, 2008, 8:27pm
 
Is there a way to read what the original dimension of an image is?
I'm doing batch processing on pictures downloaded form the internet and would like to be able to automatically differentiate based on image size.
Re: original image dimension?
Reply #1 - May 9th, 2008, 8:34pm
 
Yes, PImage has a width and height value set to the size of the image:

Code:
PImage img=loadImage( "http://processing.org/img/processing_beta.gif" );
println("Width: "+img.width+", height: "+img.height);
Re: original image dimension?
Reply #2 - May 9th, 2008, 8:42pm
 
great, thanks for the quick reply!

(I see that now in the docs...I hadn't understood that those were the original images height and width....)
Page Index Toggle Pages: 1