Forum

Thread tagged as: Question, Problem, Blog

Perch Blog: width and height of image in 'post_in_list'-template not outputting...

When I change the default crop of the Blog-image in the 'post_in_list.html'-template (50x50 pixels, crop=true) to a other value (e.g. 125x125) the image doesn't scale to this value, but it shows on its original image-size. When I set it to 50x50 again the images scales to 50x50 as it should. Am I doing something wrong here?

When I set the number 50 to e.g. 125 the image isn't scaled down

type="image" width="50" height="50" crop="true"

The full code:

<perch:before>
<ul class="hfeed listing"></perch:before>
    <li class="hentry">
        <h2><a href="<perch:blog id="postURL" />" rel="bookmark" class="entry-title"><perch:blog id="postTitle" /></a></h2>
        <perch:if exists="image"><img src="<perch:blog id="image" type="image" width="50" height="50" crop="true" />" alt="<perch:blog id="postTitle" />" /></perch:if>
        <p class="entry-published date"><perch:blog id="postDateTime" format="%d %B %Y" /></p>
        <div class="description entry-summary">
        <perch:blog id="excerpt" type="textarea" textile="true" />
        <p>Comments: <perch:blog id="postCommentCount"/></p>
        </div>
    </li>
<perch:after>
    </ul>
    <perch:if exists="paging">
        <div class="paging">
            Page <perch:blog id="current_page" /> of <perch:blog id="number_of_pages" />
            <perch:blog id="page_links" encode="false" />
            <perch:if exists="not_first_page">
                <a href="<perch:blog id="prev_url" encode="false" />">Previous</a>
            </perch:if>
            <perch:if exists="not_last_page">
                <a href="<perch:blog id="next_url" encode="false" />">Next</a>
            </perch:if>
        </div>
    </perch:if>
</perch:after>

The diagnostics report

Perch: 2.8.7
Production mode: Production (100)
Installed apps: content (2.8.7), assets (2.8.7), categories (2.8.7), perch_blog (4.6)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: 64a691b69b94d42303f74d7ef0b81579
L1: 090186224074a7b21721960c842ff871
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.7: done
latest_version: 2.8
on_sale_version: 2.8.7
perch_blog_update: 5.0
perch_blog_post_url: /blog/post.php?s={postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: flexiuy104_play
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: flexiuy104_playbase
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/Amsterdam
PERCH_EMAIL_FROM: info@flexiflyer.nl
PERCH_EMAIL_FROM_NAME: Edwin Venhorst
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html/perch
PERCH_CORE: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html/perch/core
PERCH_RESFILEPATH: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.21
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.34
MySQL server: 5.5.34
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, json, mbstring, mcrypt, mysql, mysqli, session, PDO, pdo_mysql, pdo_sqlite, standard, posix, Reflection, Phar, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 20M
PHP max form post size: 20M
PHP memory limit: 256M
Total max uploadable file size: 20M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
DOCUMENT_ROOT: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: nl-nl
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: cmsa=1; PHPSESSID=f87f8aa72c1d4b10b52303292007004e
HTTP_HOST: playground.edwinvenhorst.nl
HTTP_REFERER: https://playground.edwinvenhorst.nl/perch/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3
PATH: /bin:/usr/bin
PHPRC: /usr/local/etc/php6/cgi/
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 92.67.122.14
REMOTE_PORT: 59715
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/flexiuy104/domains/playground.edwinvenhorst.nl/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 159.253.7.224
SERVER_ADMIN: webmaster@playground.edwinvenhorst.nl
SERVER_NAME: playground.edwinvenhorst.nl
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: <address>Apache/2 Server at playground.edwinvenhorst.nl Port 80</address>
SERVER_SOFTWARE: Apache/2
UNIQUE_ID: VWh6LJ-9B@AAAFfsibwAAAAM
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1432910380.77
REQUEST_TIME: 1432910380
argc: 1

And a link to the page on my server…

Edwin Venhorst

Edwin Venhorst 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Did you resave the content after changing the sizes? Sizes are created at edit time.

Yes I did, I've just double-checked it and added a couple of blog posts with different kind of images. Still no resize. Must be something I'm overlooking but can't think of what.

Edit: Just checked again and even thought I've set my template setting to 125x125 Perch is generating a 50x50 thumbnail when I place a new blog post. So Perch isn't listening to the settings in the template or something is overruling the settings. But what?

Nailed it. Needed to set the dimensions on both 'post_in_list.html' and 'post.html'. I only did the first, now it works fine!

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes post.html is the master template. Every app has a master template and all fields need to be in there as that is where the edit form takes information from.

Thanks Rachel!