Forum
Crop images
Hi,
I have used a template to show blog posts on the home page of a website. The client has had the the CMS for a few months but the images are not being cropped even though the have been set to specific dimensions. Fopr example, one image the size of the image is 1,536px × 2,048px but the crop has been set 245px x 164px. Code below, I'm assuming that I've done something wrong because the image is much larger than what the should be so the crop sohould work. Any help would would be appreciated, thanks! :)
<div class="col-md-4 nobottommargin">
<div class="ipost clearfix">
<div class="entry-image">
<a href="<perch:blog id="postURL" />"><img class="image_fade" src="<perch:blog id="image" type="image" width="245" height="164" crop="true" />" alt="<perch:blog id="postTitle" />"></a>
</div>
<div class="entry-title">
<h3><a href="<perch:blog id="postURL" />"><perch:blog id="postTitle" /></a></h3>
</div>
<ul class="entry-meta clearfix">
<li><i class="icon-calendar3"></i> <perch:blog id="postDateTime" format="%d %B %Y" /></li>
</ul>
<div class="entry-content">
<p><perch:blog id="excerpt" type="textarea" textile="true" /></p>
</div>
</div>
</div>
Hi Jade,
Do you have
In your main
post.html
template too?You'll need it to be there so that Perch can crop it at edit time.
Hi Simon,
Yes I do, the post.html code is below
Is this the code for the section on your homepage or the blog post page itself?
You need to make sure this size is made at the time of uploading the image. i.e. When the blog post is created.
Ha - Beaten to it by Simon there!
Also you can constrain the width of the image with max-width in your css.
We need to see your Diagnostics Report.
And you've re-saved the blog post since updating the template?
Diagnostics Report:
I haver reuploaded the image, and it worked. Thanks for your help everyone :)
Yeah, remember that if you've added the image before you changed the template it won't post process it. You'd need to re-upload the image. I find it easy to check what's going on just by looking in the resources folder at what gets churned out when you upload an image.
You need to update blog to 5.5.1