CIFilter
CIFilter

Reputation: 8677

Determining Dimensions of Images in iPhone SDK

Simply, is it possible to somehow capture the dimensions (specifically, width and height) of an image using either the iPhone SDK or an iPhone SDK-compatible library/framework? Perhaps pull the dimensions from the EXIF metadata?

Upvotes: 0

Views: 2656

Answers (2)

Roukas
Roukas

Reputation: 36

If your UIImage name is image, you can get its size and then use the size to get the width and height like this:

CGSize mySize = [image size];
CGFloat imageWidth = mySize.width;
CGFloat imageHeight = mySize.height;

Upvotes: 0

Marc W
Marc W

Reputation: 19241

From the Apple API for UIImage, create a UIImage from your image data or file, then use the size property to get a CGSize structure representing the image's dimensions.

Upvotes: 3

Related Questions