So I found a bunch of images which I cant display in the correct way.
We have this very simple example:
<body>
<img src="http://vignette2.wikia.nocookie.net/runescape2/images/4/47/Santa_hat.png/revision/latest?cb=20111128052051" />
</body>
This particular image has (or should have) the dimensions 28x23, although when running this snippet in your browser it gets resized.
I think this lot of images has some format issues which prevent me from displaying them on their true dimensions.
The only way I've had this working is by assigning custom properties width
and height
, but the problem is im loading these images dynamically using JavaScript so I dont have the dimensions of these images. I've tried retrieving the dimensions, see for instance this SO answer:
Get width height of remote image from url
but that gave the scaled dimensions as they appear on the webpage after it's loaded (200x164?).
I'm unsure why this is happening and how I could load these images using the correct dimension.
Also: putting this in a jsfiddle (link) does seem to use the right dimensions.
edit: (im editting this so it can get a bump)