Resizing images to fit within posts?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Robotics Guy
Registered User
Posts: 68
Joined: Fri May 09, 2008 7:54 pm
Location: USA

Resizing images to fit within posts?

Post by Robotics Guy »

What's the best mod for resizing images to fit within posts and not just be cut-off (which is the default phpbb3 behavior)?

I found these:
ReIMG Image Resizer
HighSlide Attachment MOD
Easy Resize Posted Images - phpbb3.0.x
Auto Image Resizer w Lytebox - phpBB 3.0.1 GOLD

But I'm not sure which is the best, or if there's another, better one, that I haven't found? (ReIMG Image Resizer has the most comments, but the thread is locked for some reason, which makes me wary to consider it).

Thanks for your advice!
User avatar
Boardtalk.net
Registered User
Posts: 1222
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: Resizing images to fit within posts?

Post by Boardtalk.net »

This is the best one to go for and its the only one you've linked to that's in the Mod DB - also its very easy to install
Link: ReIMG Image Resizer
I use it on a number of forums and its very good. ;)
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70389
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Resizing images to fit within posts?

Post by KevC »

There's an even easier one

Open common.css in the theme folder and add this code to the "img" class

Code: Select all

max-width: 100%;
so, the whole thing should be...

Code: Select all

img {
	border-width: 0;
	max-width: 100%;
}
Then refresh the theme in the styles tab
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
Robotics Guy
Registered User
Posts: 68
Joined: Fri May 09, 2008 7:54 pm
Location: USA

Re: Resizing images to fit within posts?

Post by Robotics Guy »

Is max-width a new css property? I don't think I've ever seen that before. Does it work with all the browsers?

Thanks :)
User avatar
Lumpy Burgertushie
Registered User
Posts: 68479
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Resizing images to fit within posts?

Post by Lumpy Burgertushie »

Robotics Guy wrote:Is max-width a new css property? I don't think I've ever seen that before. Does it work with all the browsers?

Thanks :)
not new, been around quite a while and should work with all current browsers.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
Skulptura
Registered User
Posts: 28
Joined: Tue Mar 06, 2012 4:24 pm

Re: Resizing images to fit within posts?

Post by Skulptura »

Kevin Clark wrote:There's an even easier one

Open common.css in the theme folder and add this code to the "img" class

Code: Select all

max-width: 100%;
so, the whole thing should be...

Code: Select all

img {
	border-width: 0;
	max-width: 100%;
}
Then refresh the theme in the styles tab
Im sorry to bringing this topic up, I'm using this on version 3.0.8 and my theme is a bit messed up. New topic button is messed up and pictures in users online and stats are overlapped by text. However, pictures are resised and plugin does his job.

Theme: Hermes Green
Board: http://quantum-gaming.vacau.com/index.php

Can anyone help me with this one please?
Thanks.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70389
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Resizing images to fit within posts?

Post by KevC »

Your buttons and stats look normal to me as a guest.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
LGforum
Registered User
Posts: 9
Joined: Thu Apr 05, 2012 1:17 pm

Re: Resizing images to fit within posts?

Post by LGforum »

You can restrict the size of images within posts by opening up content.css and looking for the '.post .content' selector. You can add a max-width and height property to the images there.

Code: Select all

.post .content img {
  max-width: 400px;
  max-height: 400px;
}
To add options like 'Enlarge' or 'View Full size' etc, then that will require some Javascript of course.
Skulptura
Registered User
Posts: 28
Joined: Tue Mar 06, 2012 4:24 pm

Re: Resizing images to fit within posts?

Post by Skulptura »

@Kevin, which browser do you use. I'm on Chrome and few more reports for this issue are made by Chrome users. On IE buttons and stats looks fine, but topic with resized images looks a bit weird, edit and quote buttons are out of the formation.

So I'm guessing that is a browser-related issue? Can someone recommend to me easy-to-install mod for this issue? And not for restricting large images, I can do that in ACP, I need something to fit pictures to post width.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70389
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Resizing images to fit within posts?

Post by KevC »

I'm on firefox.

Post a screenshot of what you're seeing.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
Skulptura
Registered User
Posts: 28
Joined: Tue Mar 06, 2012 4:24 pm

Re: Resizing images to fit within posts?

Post by Skulptura »

User avatar
KevC
Support Team Member
Support Team Member
Posts: 70389
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Resizing images to fit within posts?

Post by KevC »

I see you already have a post in the support section for that style

http://www.phpbb.com/customise/db/style ... n/support/

I suggest you post another asking about the browser issue too.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
gbrl100
Registered User
Posts: 1
Joined: Mon Sep 24, 2012 12:40 am

Re: Resizing images to fit within posts?

Post by gbrl100 »

This max-width worked fine for me, exactly what I was looking for. I just suscribed to say thankyou.
Slackervaara
Registered User
Posts: 195
Joined: Thu Feb 28, 2008 7:46 am

Re: Resizing images to fit within posts?

Post by Slackervaara »

Kevin Clark wrote:

Code: Select all

img {
	border-width: 0;
	max-width: 100%;
}
Then refresh the theme in the styles tab
Changed common.css ike that and uploaded common.css to the site, emptied the cache, but when I checked with Firebug max-with: 100%; was not present. I had to go and change directly in database phpbb_styles_theme and add this line there. Then empty the cache and it was working very well.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52229
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Resizing images to fit within posts?

Post by Brf »

Slackervaara wrote:Changed common.css ike that and uploaded common.css to the site, emptied the cache,
As the post instructs, you need to Refresh the Theme.
Locked

Return to “[3.0.x] Support Forum”