1 (edited by Vanslyde 2008-10-20 05:54)

Topic: How to Restrict the Size of Signature Image Height / Weight?

Is there a way to delimit or restrict a certain amount of pixels in users' signature's images height or width?

My users are posting large images in their signatures.
I'd like to set limits in terms of image size.

Re: How to Restrict the Size of Signature Image Height / Weight?

In 1.2.* you have some options (eg disable images in sigs) under Administration > Permissions > Signatures to control use of BBcode etc as well as signature width and height (eg 4 lines etc) and use of images per se.

But it doesn't restict image dimensions in the same way as, for example, the way avatar size can be restricted to specific sizes and kilobytes.

If in doubt just disable images in sigs per se.
Not sure about 1.3.* - haven't looked.

Re: How to Restrict the Size of Signature Image Height / Weight?

You may try to set the fixed width and height in CSS properties (or kind of max-height: 200px, but this doesn't work in old IE) and hide the overflow (overflow: height).

Carpe diem

Re: How to Restrict the Size of Signature Image Height / Weight?

Anatoly wrote:

You may try to set the fixed width and height in CSS properties (or kind of max-height: 200px, but this doesn't work in old IE) and hide the overflow (overflow: height).

Making this an on/off feature would be nice.

Re: How to Restrict the Size of Signature Image Height / Weight?

Garciat wrote:

Making this an on/off feature would be nice.

Maybe extension, but not the core.

Carpe diem

Re: How to Restrict the Size of Signature Image Height / Weight?

Thanks for the suggestion sirena, but I don't want to disable the images.. just to set a Height limit.
Anatoly, should I try to implement the guidelines you provided in my forum .css (section /* 8.3 Extra top spacing for signatures and edited by */ )? as you're not talking about the *_cs.css file, right?

Re: How to Restrict the Size of Signature Image Height / Weight?

Vanslyde wrote:

Anatoly, should I try to implement the guidelines you provided in my forum .css (section /* 8.3 Extra top spacing for signatures and edited by */ )?

Yes.
Try to set the limits for the CSS class of the signature.

Carpe diem

Re: How to Restrict the Size of Signature Image Height / Weight?

Maybe

.sig-content img{
max-height: 120px; /* Replace with whatever your limit is */
}

/* The following is optional but it does help */
.sig-content{
overflow: scroll;
}

Re: How to Restrict the Size of Signature Image Height / Weight?

Garciat wrote:

Maybe

.sig-content img{
max-height: 120px; /* Replace with whatever your limit is */
}

/* The following is optional but it does help */
.sig-content{
overflow: scroll;
}

This code doesnt seem to have any effect at all on my user's images sigs. I'll investigate on the www, if I find anything I'll let you know.

Re: How to Restrict the Size of Signature Image Height / Weight?

.sig-content img{
max-height: 120px; /* Replace with whatever your limit is */
}

As I remember this will not work in IE7 and lower.

Carpe diem

11

Re: How to Restrict the Size of Signature Image Height / Weight?

Anatoly wrote:
.sig-content img{
max-height: 120px; /* Replace with whatever your limit is */
}

As I remember this will not work in IE7 and lower.

That's what you suggested.

Re: How to Restrict the Size of Signature Image Height / Weight?

Garciat wrote:
Anatoly wrote:
.sig-content img{
max-height: 120px; /* Replace with whatever your limit is */
}

As I remember this will not work in IE7 and lower.

That's what you suggested.

indeed he suggested old IE.. I gave it a shot as I didnt know my brand new IE7 was already "old" wink I just turned to IE7 cool

oh well, funny but sad at the same time.. roll

13

Re: How to Restrict the Size of Signature Image Height / Weight?

Oh, right, he did say it wouldn't work on old IE.

Re: How to Restrict the Size of Signature Image Height / Weight?

Vanslyde wrote:

indeed he suggested old IE.. I gave it a shot as I didnt know my brand new IE7 was already "old" wink I just turned to IE7 cool

oh well, funny but sad at the same time.. roll

Sorry, I use IE just to test pages as they are seen by regular users.
So inwardly I mean all versions of IE as old ones and max-width is a significant example :-)

I've just found the dirty CSS-hack, emulating min- and max-height in IE:

div{
   width: 100%;
   max-width: 1100px;
   min-width: 900px;
  *width: expression(document.body.clientWidth > 1100? "1100px": document.body.clientWidth < 900? "900px": "100%");
}

Though I did not check if it really works :-)

Returning back to the subject.

Vanslyde wrote:

Is there a way to delimit or restrict a certain amount of pixels in users' signature's images height or width?

Another way is to allow only local images in signatures and test them with getimagesize() function before displaying. Testing remote images may be tricky as I may post the link to to the 10Mb image :-)

Carpe diem