On 06/08/2010, at 12:57 AM, Brian Postow wrote:

> But... um,  then how do i fix my imgsize? this nsimage is  sometimes coming 
> from a PDFPage with:
> 
>       NSData* imgData = [pg dataRepresentation];
>       NSImage* img = [[NSImage alloc] initWithData:imgData ];
> is there a better way to get the data out of the PDFPage? 
> 
> Other times, it's coming from either a TIFF file, or raw bitmap data from a 
> scanner.


I don't know the answer to these questions, but the essential point is that if 
you have an image that is, say 8.5 x 11 inches, that's the size it should be 
set to (expressed in points). So you need to obtain the true size from whatever 
image sources you're using. If the size is present within the TIFF file header 
for example, I'd have thought that reading it using -initWithContentsOfFile: or 
-initWithData: would do the right thing. (Though not all image files are 
necessarily well-formed).

If you only have pixel dimensions, you can't determine the true size unless you 
know the resolution, or vice versa. Pixel sizes alone could mean anything.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to