NSImage's size being rounded up?

I'm bringing some fairly small .eps files into my application (1/16"), created as 4.5pt x 4.5pt. When i try to get the image sizing via NSImage's size(height & width), I'm seeing these values both being rounded up to 5pt. I've been unable to find any other means that will give me the correct dimensions so far. Has anyone seen a similar situation? thoughts on a possible solution or a cause for this rounding?




Thanks,

Eric

Replies

What if you replace .eps by .png files ?

You can change the "size" property of a NSImage object yourself, since that property is a logical size.


The real question is what kind of NSImageRep (or NSImageReps) the image contains. (Look at the "representations" property.) If there's a representation that preserves the EPS data, then it will be scaled to the NSImage size (well, the 1x or 2x or 3x scaled size, depending on the context) as you would expect.


However, if it's a bitmap representation, indicating that the EPS data was rendered to a bitmap when the NSImage instance was created, scaling is no longer helpful, and you will probably need to use an external tool to scale the .eps file content before bringing the images into your app.