Reads a JPEG image from disk and prints image info.
- Author
- Arne Petersen
#include <Base/Image/ImageBase.hh>
#include <Base/Image/ImageIO.hh>
#include <Base/Image/CompressJpeg.hh>
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
if (argc != 2) {
cout << "Usage: " << argv[0] << " <image file>" << endl;
return -1;
}
int res = 0;
if (res < 0) {
BIASERR("Reading JPEG failed (returned "<< res <<")!");
return -1;
}
if (res < 0) {
BIASERR("Decompression failed (returned "<< res <<")!");
return -1;
}
cout <<
"Image size: " << image.
GetWidth() <<
"x"
cout << "Image metadata:" << endl;
} else {
cout << "No image metadata found." << endl;
}
return 0;
}