It appears that the image attributes are being set according to the height and width of the minplayer-loader-wrapper and are resizing after the Image Style has been applied. Shouldn't the height and width come from the Image Style only?

Comments

aniebel’s picture

Also, if I don't include height and width in the Player Presets, the preview image doesn't show up at all.

travist’s picture

Status: Active » Postponed (maintainer needs more info)

Is this in Colorbox? If so, then I just committed a fix for that.

If not, then I will need more information about your setup to determine what issue you are running into?

aniebel’s picture

Hi travist, no it's not Colorbox. I am using a custom template where I have copied the default template to add additional fields to the thumbs and preview.

I currently have the preview image set to thumbnail just to try and troubleshoot and image styles is successfully creating that image. It's being resized then (enlarged) to fit the container.

Here's the css that's being generated for the preview image: http://screencast.com/t/us3DVwqzD1

I found this in osmplayer.js, line 3038 :

/**
 * Resize the image provided a width and height or nothing.
 *
 * @param {integer} width (optional) The width of the container.
 * @param {integer} height (optional) The height of the container.
 */
minplayer.image.prototype.resize = function(width, height) {
  width = width || this.display.parent().width();
  height = height || this.display.parent().height();
  if (width && height && this.loaded) {

    // Get the scaled rectangle.
    var rect = this.getScaledRect(this.ratio, {
      width: width,
      height: height
    });

    // Now set this image to the new size.
    if (this.img) {
      this.img.attr('src', this.loader.src).css({
        marginLeft: rect.x,
        marginTop: rect.y,
        width: rect.width,
        height: rect.height
      });
    }

    // Show the container.
    this.img.fadeIn();
  }
};
aniebel’s picture

As a test, I switched to another preset I created using the default template instead of my custom template and am seeing the same results. The preview image that I have set as thumb style in Views is being resized to fit the containing div.

aniebel’s picture

Status: Postponed (maintainer needs more info) » Active