Forum

Thread tagged as: Question, Problem

Crop not working...

I'm trying to crop images when they get uploaded onto a page. It's just not working...

Here's my template code:

        <article data-id="id<perch:content id="perch_item_index" type="hidden" />" data-type="<perch:content id="datatype" type="text" help="wordpress, html, Javascript, perch, design" label="Filter Group" />" class="span3">
            <div class="thumbnail hover-pf5">
                <img src="<perch:content type="image" id="image" label="Image" width="370" height="260" crop="true" density="2" />" alt="<perch:content type="text" id="alt" label="SEO Description ALT Text" required="true" title="true" />" />
                <div class="mask-1"></div>
                <div class="mask-2"></div>
                <div class="caption">
                    <h2 class="title" style="background-color:#ff8500;"><a href="<perch:content type="text" id="url" title="true" label="Live Link" >"><perch:content id="titletext" type="text" label="Title" required="true" title="true" /></a></h2>
                    <p><perch:content id="description" type="text" label="Description" required="true" title="true" /></p>
                    <a href="<perch:content type="text" id="url" title="true" label="Live Link" />"  class="info btn btn-inverse"><perch:content id="anchortext" type="text" label="Link Text" required="true" title="true" /></a>                    
                </div>
            </div>
        </article>

I'm getting around this by pre-configuring the images... A right pain in the ...

Thanks for your help Steve

Steve Counsell

Steve Counsell 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please let us see your Diagnostic Report.

Rachel Andrew said:

Please let us see your Diagnostic Report.

Here's the diagnostics...

Perch: 2.8.10, PHP: 5.4.23, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $, with PDO
Server OS: Linux, litespeed
Installed apps: content (2.8.10), assets (2.8.10), categories (2.8.10), perch_blog (4.6), perch_events (1.9.2), perch_forms (1.8.2), perch_gallery (2.8.6), perch_mailchimp (2.0.1), perch_members (1.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', 'perch_mailchimp', 'perch_forms', 'perch_gallery', 'perch_events', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/stevecou/public_html/perch
PERCH_CORE: /home/stevecou/public_html/perch/core
PERCH_RESFILEPATH: /home/stevecou/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
Resource folder writeable: Yes
HTTP_HOST: stevecounsell.com
DOCUMENT_ROOT: /home/stevecou/public_html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you uploading images that are larger than the crop size?

Drew McLellan said:

Are you uploading images that are larger than the crop size?

Yes. The one I am testing is 350px X 500px it should be cropping to 350 X 260....

What am I getting wrong?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your crop size is 370, so it's not large enough.

Oh, I see... It'll only crop IF both sides are too big???

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's right - otherwise it would need to scale up.

Cool thanks Drew ;)