Forum

Thread tagged as: Question, Problem

Image size is not correct

Perch: 3.1.2, PHP: 7.0.31, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2)
App runtimes: <?php $apps_list = [ ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/rest/domains/r-e-s-t.be/public_html/perch
PERCH_CORE: /home/rest/domains/r-e-s-t.be/public_html/perch/core
PERCH_RESFILEPATH: /home/rest/domains/r-e-s-t.be/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 64M, Memory: 128M, Total max file upload: 64M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/rest/domains/r-e-s-t.be/private_html
HTTP_HOST: r-e-s-t.be

When I'm adding a gallery item on this page https://r-e-s-t.be/gallery-persoonlijke-trainer-antwerpen.php, the image size is cropped and not correct. How can I fix this? The html version is here: https://r-e-s-t.be/gallery-persoonlijke-trainer-antwerpen.html

Image information next to the first image in Perch with the runner is : CP20x30 and 2000x2992px@998kb. It should be cropped to 800x650.

Gallery region:

<li class="grid-item wow fadeInUp">
                                <a>
                                    <figure>
                                        <div class="portfolio-img">
                                          <perch id="images" label="Images">
                                           <li>
                                           <img src="<perch:content id="image" type="image" label="Image" />" /> 
                                           </li>
                                          </perch>
                                        </div>
                                        <figcaption>
                                            <div class="portfolio-hover-main text-center last-paragraph-no-margin">
                                                <div class="portfolio-hover-box vertical-align-middle">
                                                    <div class="portfolio-hover-content position-relative">
                                                        <span class="font-weight-600 alt-font text-uppercase margin-one-bottom display-block text-extra-dark-gray"><perch:content id="gallery_title" type="smarttext" label="Titel" required="true" title="true" /></span>
                                                        <p class="text-medium-gray text-uppercase text-extra-small"><perch:content id="gallery_text" type="smarttext" label="Omschrijving" required="true" title="true" /></p>
                                                    </div>
                                                </div>
                                            </div>
                                        </figcaption>
                                    </figure>
                                </a>
</li>
Frederic Desauw

Frederic Desauw 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Your image tag doesn't have any sizes set

<perch:content id="image" type="image" label="Image" />

Yes,

When I do that, it still doesn't work properly. For example:

 <img src="<perch:content id="image" type="image" label="Image" width="800" />" /> 

Outcome: https://r-e-s-t.be/gallery-persoonlijke-trainer-antwerpen.php Instead of: https://r-e-s-t.be/gallery-persoonlijke-trainer-antwerpen.html

Whether the image is large or small, it's cropped to a small thumbnail.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do the sizes match those you used when uploading the image?

Yes indeed

Drew McLellan

Drew McLellan 2638 points
Perch Support

The source of your page is including the w800 image. You also have some sort of weird <perch> tag in the source, so check that. I think this is probably a front end issue.

The source of the gallery.html page? What do you mean with the weird <perch> tag. I don't find it.

Now I've tried with a crop, and outcome is next to the image: 800 x 650px @ 81KB. So it's ok, but live the image is again too small. I don't see the link with my css, because this part is the same as the html file that displays correctly. I have another site with gallery items coming up, so I want to find this problem, so I can go further. Other pages with text tags works fine.

<perch id="images" label="Images">
                                           <li>
                                           <img src="<perch:content id="image" type="image" label="Image" width="800" height="650" crop="true" />"  />
                                           </li>
                                          </perch>
Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean with the weird <perch> tag. I don't find it.

and yet you've quoted it back to me:

<perch id="images" label="Images">