Forum Moderators: open

Message Too Old, No Replies

IE7 enlarging jpg img

IE7, jpg size

         

likes2burn

8:22 pm on Mar 19, 2010 (gmt 0)

10+ Year Member



I have a peculiar problem with the <img> tag in IE7. Needless to say my <img> works in every other browser. I've be unable to find anything online adequately describing this so here goes:

IE7 is enlarging my JPG image, and then cropping it down to the specified size set in the <img> tag. The JPG itself is the actual size that the <img> tag declares.

I have a <DL> with the <img> tag nested inside of a <dd>. It appears as such:

<dd class="img"><img src="../img/profile/person.jpg"
width="155px" height="196px" alt="Person person" />
</dd>


IE7 has determined that this size should be 163x204px. If I click properties this is the size that reads out. The actual size of the image is 155x196. If I save the image from IE7 it saves a file that is 155x196px.

It is definitely expanding the image, and cropping it down to 155x196. If I take a screen shot of the webpage in IE and in Firefox I can then take the one <dd> element and place it over the other perfectly.

I can't even begin to understand this behavior, but needless to say my JPGs are coming through pixelated and oddly cropped.

Please help if you can. The closest IE knowledge base article I found is this: [support.microsoft.com...]

But none of the images qualify as an EMF, and definitely don't use vector graphics. Clearly the pixelation is from raster graphics being incorrectly zoomed in.

dreamcatcher

8:45 pm on Mar 19, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are using the tag incorrectly. You don`t specify px in the size:

<img src="../img/profile/person.jpg"
width="155" height="196" alt="Person person" />

Or using styles (where you would use px);

<img src="../img/profile/person.jpg"
style="width:155px,height:196px" alt="Person person" />

dc

likes2burn

6:22 pm on Mar 22, 2010 (gmt 0)

10+ Year Member



Unfortunately that doesn't work. The image still comes through on IE7 is a fictional size, 163x204. The size of the actual image is only 155x196.

While this may seem like a small difference, in my smaller JPGs images that are 15x20 are enlarged to 22x29.

drhowarddrfine

6:36 pm on Mar 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure you're not zoomed in? Hit ctl-0 and see if that fixes it.

likes2burn

6:52 pm on Mar 22, 2010 (gmt 0)

10+ Year Member



Tried it and checked the settings and I'm not zoomed in. PNGs and GIFs aren't affected by this peculiarity though.

Also there's no style element that sets a zoom, or attempts to change it.

At this time, I've had to just change the visually obvious images to a different format. Though I would like to get to the bottom of it. Do any IE developers ever use this forum?

tedster

1:14 am on Mar 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There may be something buggy about the jpg that the browser can't deal with. The .jpg format holds a veritable junk drawer of possibilities.

I would suggest returning to the source image and saving the production version again. If you use Photoshop, be sure to use "Save for the web."