1

I am pulling in images / video thumbs using Channel Video (so have no control over source size). If the video doesn't have an HD thumb, the image is much smaller.

I want the image to be resized (stretched) up the way and cropped in these instances. So, no matter what the image size is, it ends up with the dimensions below...

{exp:ce_img:single src='{video:img_url_hd}' width='480' height='308' crop='yes|center,center' output='{made}' quality='68'}

This works correctly for images larger than the above dimensions. But smaller images stay the same.

I guess I am asking:

1) Would I be right in saying the resize and crop has no effect on images smaller than the desired/specified dimensions?

2) Is there a way for force the resizing and cropping on these smaller images?

3

I haven't used CE Image, but looking at the documentation it seems you need a parameter "allow_scale_larger" http://www.causingeffect.com/software/expressionengine/ce-image/user-guide/parameters#allow_scale_larger

And here's how you can achieve the cropping effect with CSS: http://jsfiddle.net/s552453s/ Unfortunately you are limited to cropping from the top instead of center without using Javascript to calculate image heights dynamically and use the padding/margin hack to center it within the div.

  • allow_scale_larger="yes" does the trick. CE Image also crops from the center by default, but that can be changed using the crop= parameter. – Aaron Waldon Sep 17 '14 at 15:31
  • Perfect! Missed that one. Cheers Kerry – Glen Sep 17 '14 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.