Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

After update images with @3x are displayed too large

Started by Markus Durrer 4 years ago · 8 replies · 370 views
4 years ago

In my web pages I have included bliders with [email protected] or [email protected]. Since the update from Grav 1.6 to Grav 1.7 (I think it was in this update) the images are no longer displayed correctly, but triple, respectively twice as wide.
How can I fix this error without reducing the size of the original images.
Example page

4 years ago

@madu, Could it be you have changed some css earlier...

Try adding the following to user/themes/bauhygiene/css/main.css :

CSS
img {
  width: 100%;
}

or something similar to suit your needs...

last edited 02/22/22 by pamtbaau
4 years ago

@pamtbaau: No, I did not change anything in the css, the scaling did not work after the grav-update.

In the main.css the following is set:

CSS
img {
  font-size: 16px;
  font-size: 1.6rem; }

figure {
  display: block;
  margin-top: 24px;
  margin-bottom: 24px;
  text-align: center; }
  figure.align-left {
    text-align: left; }
  figure.align-right {
    text-align: right; }
  figure.float-left, figure.float-right {
    margin-top: 8px;
    margin-bottom: 8px;
    clear: both; }
  figure.float-left {
    float: left;
    margin-right: 16px; }
  figure.float-right {
    float: right;
    margin-left: 16px; }
  figure figcaption {
    font-size: 14px;
    font-size: 1.4rem;
    font-style: italic; }
  figure img {
    max-width: 100%; }
    figure img.full {
      max-width: 100%; }
    figure img.half {
      max-width: 50%; }
last edited 02/22/22 by Markus Durrer
4 years ago

@madu,

  • Before delving into your css snippets, did you try my suggestion?
  • Why are you setting font styles on an image?
  • What's the use of figure if the img is not inside a figure?
4 years ago

@pamtbaau: Yes, I added that to the existing main.css in addition, once at the beginning and once at the end. After that I deleted the cache. That did not fix the appearance of the page. But thanks for the tip.
I did not create the template and css for these pages myself. The web designer who did this is unfortunately unavailable until at least the end of 2022.

4 years ago

@madu, It seems you've now added width: 100% to user/themes/bauhygiene/css/main.css at line 767 and the images look ok to me now.

By the way, it seems the English and French translations are broken, because of incompatibility with Grav 1.7.x. See Most Common Issues in the upgrade to 1.7 docs.

That seems a bit strange, because I would expect the same template is used for German, English and French. If the template displays German correctly for Grav 1.7, the other languages should too.

last edited 02/22/22 by pamtbaau
4 years ago

@pamtbaau: I added this formatting to the existing img block after the position at the beginning or at the end did nothing. Unfortunately the @3x images are still displayed too large with Chrome on my 24" monitor. All images, which only have a width of 704 px, as well as svg, are displayed correctly.

However, with the Edge or Opera browser, the @3x images are scaled correctly.

Also on my Android tablet the display with Chrome is now correct.

The FR and EN pages are redirected to bauhygiene.eu which does not work anymore, the pages of bauhygiene.ch is not multilingual created. This explains your finding ;)

last edited 02/22/22 by Markus Durrer
4 years ago

Now I have not only reloaded the page in Chrome, but also deleted the chache of the browser. Thus, the images are also displayed in this browser in the correct size. :)

4 years ago

@madu, Nice! You may then mark the post as solved by ticking the 'solution' icon in the lower right corner of the reply that led to the solution.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
3 90 1 hour ago
Support · by Anna, 3 days ago
2 92 22 hours ago
Support · by Justin Young, 23 hours ago
1 40 23 hours ago
Support · by Duc , 1 week ago
2 98 6 days ago
Support · by Colin Hume, 1 week ago
2 90 6 days ago