Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
I'm putting images into my xcode project, and it's choosing to shrink some of them drastically, well past a usable point. It's not doing it to all of them, it's not just doing it to big ones, and it's not just doing it to small images. Deleting the image and then putting it back in doesn't fix it. How do I stop this from happening?
 
Wait a second here, when browsing in the resources is your image shrunken, or is it shrunken when displayed on the XIB? The latter is just some settings you need to adjust. The images might be "shrunken" to fit in the resource preview, but they aren't actually reduced in size.

We need some more details here :)
 
In xcode, when I select the shrunken ones from the list, the preview is very small. When I go to the media library in IB, the preview there is the same size as all the other previews, just extremely pixelated to an unrecognizable point. When I drag one around but not onto the window yet, it's a bigger pixelated picture than the preview. When I drop it onto a window, I get an image approximately 50x20, not pixelated but waaaaaaaay too small. The object also has a lot of blank opaque space around the image, within the object bounds. The mode is set to center by default, doing any mode that makes it bigger means getting the extremely pixelated image again. It's not just showing a shrunk version, it seems to actually be shrinking the image, except that going to the image in finder, it's still the original size.
Nate
 
Please don't bump threads, it's not only very rude but it's also against the forum rules.

The only thing I can think to suggest is to check the DPI settings within the images. XCode may well respect this.
 
lipton, I really don't know what you're talking about. Can you post some screenshots or images that have been shrunken?
 
@robbie - Sorry wasn't thinking...
How do I check the dpi?

@phoney -
In preview, viewed from finder.
1.png


Selected in xcode.
2.png


Selected in IB.
3.jpg


Dragged onto a view in IB.
4.png
 
Haven't seen this. Robbie is right, if the image is 300 dpi that might explain this. You can certainly view the dpi in Photoshop.

I don't have any images as large as this in my projects. I added a screen shot jpeg of about 1100 x 600 to a test project. When I view it in Xcode or in IB in an image view it shows as full size. In IB in the media view in the Library window it is scaled down to fit the size of the space. This is different from what you're seeing.
 
Ok, the two images currently in my project that are doing this have a dpi of 300. (Well, one is .3 below) How can I change this? Preferably, how is it avoided in the first place, even more preferably in gimp. Otherwise, I have photoshop at my disposal. Thanks so much guys.
Nate
 
I don't know about gimp, although I'm sure it can do this.

In PS open the image and choose Image -> Image Size. Change the resolution there from 300 to 72 pixels per inch. You'll probably also have to change the height and width to the size you want. It should also Resample Image, which will smooth the resulting image.

I guess your image was scanned. When you scanned it you chose the resolution. I would say it's normal to scan at a higher resolution and then later adjust the resolution for your needs. If you scan at 72 dpi then you may have quality problems if you do need to resize it very much.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.