Hi!
Real featured images (the ones you upload to your media library) are automatically cropped and scaled based on your theme’s settings. When the theme retrieves and renders a featured image, it asks for a specific thumbnail of the original image you uploaded (sometimes, this thumbnail is the actual, full-size image).
With external featured images, no “scaling” or “cropping” processed is applied – you simply tell our plugin the URL of the featured image and we do our best to mimic WordPress default behavior. This is how our plugin renders the external featured image: it loads a 1px transparent GIF image and scales it to the proper size using CSS rules. Then, the actual featured image is set as the background of that img
tag, so that it can be scaled and cropped without stretching the image.
Clearly, the problem occurs because we can only approximate the size of the featured image. For instance, if your theme loads a 500x400px image, the best we can do is load an image tag as follows:
<img src="transparent-pixel.gif" style="width:500px;height:400px;" />
which, apparently, will look like a featured image from the media library. In reality, though, there are some problems. For example, if the container that contains the image is scaled down, a regular image might be also scaled down, maintaining the aspect ratio. With our external img
tag, though, this is not possible; we set an exact width and height, so there’s no way that the image can be scaled up and down.
The only possible solution is to define multiple CSS rules with @media
queries, so that the proper width and height values are set at concrete screen sizes (480px, 520px, 640px, 720px, and so on) and try to “mimic” WordPress behavior with CSS rules. This is far from ideal, but it’s the best solution we have right now.
Does this help somehow?