Getting Image resolution

Hi,

I’ve been trying to get the resolution of an image by using xxx.getWidth() and xxx.getHeight() but it always seems to be returning 24576x24576 but the size of the image is 600x551.

This is for a college lab exercise so I have a methods in a class to retrieve both the width and the height.

//in class .cpp file
int ImageClass::imageWidth(){
image.getWidth();
}
int ImageClass::imageHeight(){
image.getHeight();
}

I am then trying to display this data by storing it in a string to be displayed.

//in ofApp.cpp file
string imageResolution = "Image Resolution: "+ofToString(image.imageWidth())+ofToString(“x”)+ofToString(image.imageHeight());

Any help would be appreciated.

Hi,
you forgot the return keyword in your method definition, like this:

//in class .cpp file
int ImageClass::imageWidth(){
return image.getWidth();
}

Thats it, thank you very much