3

I've got some images that are not square (portrait and landscape format), but I want them cropped square with CE Image.

I've tried various parameters from the documentation, but the results are stretched unnaturally. I'd prefer to have the image cropped to center and not scaled.

{exp:ce_img:single src="{image}" filter="grayscale" filename_suffix="-OFF" unique="none" class="fadein" max="192" crop="yes|center,center|0,0|no"}
  • Have you tried with crop turned on AND setting the width and height? Also, have you tried with smart scale on? – Natetronn Dec 4 '12 at 3:01
2

What Brett suggested above should work. Maybe you can try with the tag pair approach ? Again, very simple example you can build upon.

{exp:ce_img:pair src="{cf_news_img}" width="200" height="200" crop="yes|center,center"}<img src="{made}" alt="{title}" />{/exp:ce_img:pair}
| improve this answer | |
  • Looks like you are using imgsizer vs CE Image in your example. – Natetronn Dec 5 '12 at 7:00
  • Indeed, corrected ... more thee needed – Jérôme Coupé Dec 5 '12 at 20:39
12

This has always worked for me:

{exp:ce_img:single src="{url}" width="200" height="200" crop="yes|center,center" }

You can obviously add any additional paramaters (offset, filter, etc), but give this simple example a shot and try adjusting from there.

| improve this answer | |
  • exactly what I was going to suggest. – CreateSean Dec 5 '12 at 20:57

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.