Currently, inline thumbnails of images that don't have an aspect ratio of prvWxprvH (whose values are hard-coded in imce-content.tpl.php) are displayed distorted.

I've attached a very simple patch that makes inline thumbnails shown in the file list to be displayed according to the image's aspect ratio (only height is adjusted, width remains constant at prvW).

Comments

paul2’s picture

I tested my patch in IE and the thumbnails were oversized. Apparently IE decides to ignore both width and height attributes of the <img> tag if even just one of the CSS width/height is provided. So I just added another line to force the CSS width to be prvW.

ufku’s picture

Status: Needs review » Needs work

thanks for the patch, however it ignores prvH value which may result in thumbnail heights bigger than prvH. And also images smaller than (prvW x prvH) are forced to scale up.

ufku’s picture

FYI, I've just committed a fix to 6.x branch. Thank you for your effort.

ufku’s picture

Status: Needs work » Fixed
yelloroadie’s picture

It seems this fix has solved the problem for "small" thumbnails, but medium, large etc still crop the original image and do not respect the aspect ratio.

What would be really nice, would be two options:

  1. Create square thumbnails to the exact dimensions specified
  2. Create relative sized thumbnails, where the longer side is constrained by the appropriate maximum. ie. If original image is 800x600 and my thumbnails are set to 80x80 max, this would create an 80x60px thumbnail. Quite often I do not want white space around my thumbnails.
ufku’s picture

this issue is about inline thumbnail preview, not thumbnail creation. You should open a separate feature requesting issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.