Strange Image Thumbnail Display in Editor

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 30, 2011   (RSS)

Re: [gkornbluth] Strange Image Thumbnail Display in Editor

By Jason - July 30, 2011

Hi Jerry,

The reason for this is that the image CMS Builder displays inside the record editor comes from a function called showUploadPreview().

In this function, a width for the preview image is set. This has been hardcoded to use a width of 50 in the function call. So if your image has dimensions of 10 X 500, it has an aspect ratio of 1:50. So if the preview image is given a width of 50, it has a height of 2500!

If you want to override this to use the thumbnail width, here is some code to do this. Please note that I only tried this change in version 2.11 and if you upgrade your installation, this change would be overwritten.

Open up cmsAdmin/lib/menus/default/uploadList.php. On line 98 you should see this:

<?php showUploadPreview($row, 50); ?>

You can make this change to it:

<?php

$width = 50;
if ($row['isImage'] && $row['hasThumbnail']) {
$width = $row['thumbWidth'];
}
?>
<?php showUploadPreview($row, $width); ?>


this will use the images first thumbnail width. If a thumbnail doesn't exist, it will default back to 50.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Strange Image Thumbnail Display in Editor

By gkornbluth - July 30, 2011

Thanks Jason,

I'll give it a try.

Any chance you could make this permanent in the next version?

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Jason] Strange Image Thumbnail Display in Editor

By gkornbluth - July 30, 2011

Oh so much better!!!

Thanks Again
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php