Forum

Thread tagged as: Problem, Events

Image not cropping in Events template?

Just checking we have not missed something, but images upload to Events app are not being cropped/resized? They are kept all full upload size and just scaled down by the CSS.

Template:

<img src="<perch:events id="image1" type="image" label="Image 1" width="520" height="300" crop="true"/>" alt="<perch:events id="eventTitle" />" />

If this was an older bug, I am about to update Perch version and Event app. Will advise if still an issue.

Current versions: content (2.2.9), perch_events (1.7.1)

Thanks.

Stuart Farrell

Stuart Farrell 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please update Perch and report back, including your Diagnostic Report and the complete template.

OK, have updated to the latest Perch, Blog, Events and Form apps too. No change with photo cropping?

Diagnostics:

Perch: 2.8.7, PHP: 5.4.38, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.8.7), assets (2.8.7), categories (2.8.7), perch_blog (4.6), perch_events (1.9.2), perch_forms (1.8.3) App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_events/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); ?> PERCH_LOGINPATH: /cms PERCH_PATH: /home/globalo/public_html/cms PERCH_CORE: /home/globalo/public_html/cms/core PERCH_RESFILEPATH: /home/globalo/public_html/cms/resources Image manipulation: GD PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M Resource folder writeable: Yes DOCUMENT_ROOT: /home/globalo/public_html HTTP_HOST: globalortho.com.au REQUEST_URI: /cms/core/settings/diagnostics/ SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using matching image settings in the template you're using to display as well as the master template?

I wasn't, but I changed this and it didn't make any difference... :-(

event-detail.html in "events/listing" and event.html under "events".

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me both?

<header class="page-title">
    <h2><perch:events id="eventTitle" /></h2>
    <p class="date"><perch:events id="eventDateTime" format="jS F Y" /></p>
</header>

<section class="section news-item">
    <article class="post-detail">
        <div class="clearfix">
            <div class="content">
                <perch:events id="eventDescHTML" type="textarea" html="true" editor="tinymce" />
                <perch:if exists="quote">
                    <blockquote><perch:events id="quote" type="text" label="Quote" /></blockquote>
                </perch:if>
                <perch:if exists="bullets">
                    <perch:events id="bullets" type="textarea" html="true" editor="tinymce" label="Bullet Points" />
                </perch:if>
                <perch:if exists="morecontent">
                    <perch:events id="morecontent" type="textarea" html="true" editor="tinymce" label="Extra Content"/>
                </perch:if>
            </div><!-- /.content -->
            <div class="images">
                <perch:if exists="image1">
                <div class="image">
                    <img src="<perch:events id="image1" type="image" label="Image 1" width="520" height="300" crop="true"/>" alt="<perch:events id="eventTitle" />" />
                    <perch:events id="image1title" type="text" label="Image 1 Title" />
                </div>
                </perch:if>
                <perch:if exists="image2">
                <div class="image">
                    <img src="<perch:events id="image2" type="image" label="Image 2" width="520" height="300" crop="true"/>" alt="<perch:events id="eventTitle" /> 2" />
                    <perch:events id="image2title" type="text" label="Image 2 Title" />
                </div>
                </perch:if>
            </div><!-- /.images -->
        </div>

        <ul class="links">
            <!-- AddThis Button BEGIN -->
            <li><a class="addthis_button share-link" href="https://www.addthis.com/bookmark.php?v=300&amp;pubid=xa-51fa13e80e64ef9e"><i></i>Share</a></li>
            <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51fa13e80e64ef9e"></script>
            <!-- AddThis Button END -->
            <perch:if exists="newsdownload1">
                <li><a href="<perch:events id="newsdownload1" type="file" label="News Download 1"/>" class="pdf-link"><i></i><perch:events id="newsdownload1title" type="text" label="News Download 1 Title"/> - <small><perch:events id="newsdownload1size" type="text" label="News Download 1 Size"/></small></a></li>
            </perch:if>
            <perch:if exists="newsdownload2">
                <li><a href="<perch:events id="newsdownload2" type="file" label="News Download 2"/>" class="pdf-link"><i></i><perch:events id="newsdownload2title" type="text" label="News Download 2 Title"/> - <small><perch:events id="newsdownload2size" type="text" label="News Download 2 Size"/></small></a></li>
            </perch:if>
        </ul>

    </article><!-- /.post-detail -->

</section><!-- /.section -->

The only difference now in both is the Add This element.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you resaved the content since changing the image sizes?

Yep. And the strange thing is, in the CMS it's now showing a cropped size next to the image, displaying the thumb in the CMS page but the full original image just scaled down on the event detail page??

Drew McLellan

Drew McLellan 2638 points
Perch Support

Clutching at straws, but can you check the formatting of your tag:

<perch:events id="image1" type="image" label="Image 1" width="520" height="300" crop="true"/>

vs

<perch:events id="image1" type="image" label="Image 1" width="520" height="300" crop="true" />

BINGO! That was it.......

BTW - is there any way to set cropping from the TOP down of an image, rather than center?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, cropping is currently always from the centre.

OK.

+1 to suggestions list