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

Page media images not showing as resized

Solved by Hugh Barnes View solution

Started by Ade Thompson 7 years ago · 3 replies · 453 views
7 years ago

Hi, New to Grav and loving it so far but have come across an issue with resizing images using Page media.

I have attached an image (avatar.png) to my page and I'm using the following code to resize it:

![](avatar.png?resize=50,50)

but this is the output on the page:

45|515x500

It looks like the image IS resizing down from the original image size (400x400) but its still displaying it at the original image size. If I check the page source I can also see the image is 50x50.

I'm using the Cacti theme if this is relevant.

Any help grateful.

EDIT: It's showing the image in the correct size within preview which makes me think this is theme related.

Looking into the CSS for the theme I found the issue:

CSS
img {
    width: 100%; */
    max-width: 100%; */
    border-radius: 3px;
}

I commended out the width code which resolved it for me:

CSS
img {
/*  width: 100%; */
/*  max-width: 100%; */
    border-radius: 3px;
}
👍 1
last edited 09/22/19 by Ade Thompson
7 years ago Solution

Hi, glad you solved your problem, well done! I went to mark this solved but can't because you edited your original question. This is a new problem for me, just mentioning that because it's probably better for this reason in future to answer your own question by replying to yourself. Then I can mark the solution post as solution 🙂

7 years ago

LOL, I have no idea!

👍 1

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 64 18 hours ago
Support · by Anna, 3 days ago
2 68 21 hours ago
Support · by Justin Young, 21 hours ago
1 35 21 hours ago
Support · by Duc , 1 week ago
2 71 6 days ago
Support · by Colin Hume, 1 week ago
2 63 6 days ago