New Reply

Possible new feature?

 
Share Thread Thread Tools
Apr8-11, 09:12 AM   #1
 
Recognitions:
Gold Membership Gold Member

Possible new feature?


Is it possible to get the forum software to either resize or reject huge images when people post them? The earthquake/nuclear reactor thread is riddle with them, and they blow up browser windows to the point that it is very difficult to read the posts.

Thanks.
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Front-row seats to climate change
>> Attacking MRSA with metals from antibacterial clays
>> New formula invented for microscope viewing, substitutes for federally controlled drug
Apr8-11, 10:01 AM   #2
 
Blog Entries: 8
Recognitions:
Gold Membership Gold Member
Quote by turbo-1 View Post
Is it possible to get the forum software to either resize or reject huge images when people post them? The earthquake/nuclear reactor thread is riddle with them, and they blow up browser windows to the point that it is very difficult to read the posts.
This question came up before, I believe it can't be done simply as it would require the server to hold or process each image on load for sizing.

Thread should be around here somewhere.

EDIT: Here it is - http://www.physicsforums.com/showthread.php?t=432141
 
Apr8-11, 10:29 AM   #3
 
Admin
Quote by turbo-1 View Post
Is it possible to get the forum software to either resize or reject huge images when people post them?
Report these posts please. I already did some cleaning and I am trying to react live, but - unlikely as it may sound - there are moments when I am away from my computer.
 
Apr8-11, 10:30 AM   #4
 
Blog Entries: 9
Recognitions:
Gold Membership Gold Member

Possible new feature?


I think it may be possible to lower the allowed image size for attachments, not sure about for img tags. (Would vBulletin be able to size them using width or height attributes for <img /> tags?)
 
Apr8-11, 10:31 AM   #5
 
Recognitions:
Gold Membership Gold Member
Thanks, jnj.
 
Apr8-11, 07:00 PM   #6
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Quote by Borek View Post
Report these posts please. I already did some cleaning and I am trying to react live, but - unlikely as it may sound - there are moments when I am away from my computer.
That is really kind of you Borek.

Thank you for your work on this annoyance.
 
Apr13-11, 11:18 AM   #7
 
Recognitions:
Gold Membership Gold Member
Quote by Borek View Post
Report these posts please.
There is one post that is completely 'insane'... but the guy is a mentor, so I don’t know if I dare to report him...?

()
 
Apr13-11, 11:19 AM   #8
 
Recognitions:
Gold Membership Gold Member
Quote by jarednjames View Post
This question came up before, I believe it can't be done simply as it would require the server to hold or process each image on load for sizing.
AFAICT this problem does not require any server side solutions. It could be solved with very simple JavaScript reading the width of images in new posts:
<script language='JavaScript'>
function getImgSize(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'x'+height);
}
</script>
Then there are alternate solutions how to handle this info, at new posting:
  1. You decide that images wider than xxx pixels are not allowed, and inform the user (to rescale).
  2. You decide to allow all images, but you let the browser handle the 'scaling'.

In case of alt 2, there shouldn’t be a problem to calculate proportional 'scaling' and add the new allowed width to the <img> tag. If we take the monstrous () image above, this would happen:
  • Original width & height = 8219 x 600
  • JavaScript decides this is too wide, max width allowed = 800 px (or other)
  • Scale ratio is 10.27375 and the new allowed size will be = 800 x 58
  • Finally we add this new size in the <img> tag
<img src="http://www.bpp.com.pl/IMG/panorama_z_dachu.jpg" border="0" alt="" width="800" height="58" />
(In current solution on PF width & height is not set in the <img> tag)

The drawback with the second solution is that the scaling is not "real", but temporary done by the browser, on the run. This could have the peculiar effect that pictures that looks fairly small, could take some time to load, and this could possible 'confuse' the user. This solution will also put some workload on the client, but this should be negligible on modern processors.

Problem gone! It’s just up to Greg and the staff to choose solution!

(Naturally, if one utilizes ASP or PHP, there’s more 'flexibility')


EDIT:
Here’s a descriptive demo on what happens (and as you see, no one get server access... ), just change value for width & height and click the button:

http://www.w3schools.com/tags/tryit....tml_img_height
 
Apr13-11, 03:09 PM   #9
 
Its also possible to put images inside a <div style='width:100%;overflow;hidden;'>IMG HERE</div>. Then the image doesnt get resized, but the part that is too big isnt shown.
 
Apr13-11, 04:14 PM   #10
 
Recognitions:
Gold Membership Gold Member
Quote by pftest View Post
Its also possible to put images inside a <div style='width:100%;overflow;hidden;'>IMG HERE</div>. Then the image doesnt get resized, but the part that is too big isnt shown.
Yes could be a solution, but are you sure overflow works on all (older) browsers? And what happens inside a <table width='100%' ... > as used on PF?

What is neat with JavaScript is that you can extend the functionality to include a user dialog (on new post) and/or automatic linking to original image, for example:


(This image has been resized, the original can be found here.)

I have to add that this solution will not put workload on the PF server. All large images are loaded from an external source, as above.
 
Apr21-11, 04:28 AM   #11
 
Blog Entries: 1
Recognitions:
Science Advisor Science Advisor
There's a vBulletin plugin that I think I've seen used on another forum I frequent:
http://www.vbulletin.org/forum/showthread.php?t=176531

Mea Culpa: Stanley's glory is too big to contain!
http://www.physicsforums.com/showthread.php?t=490993
 
Apr22-11, 09:05 PM   #12
 
Recognitions:
Gold Membership Gold Member
To all,

With the exception of the suggestions for resizing presented in this thread, I don't use it, but how does Face (Plant) Book do it ? It seems to work nicely for them ?

Rhody...
 
Apr22-11, 11:12 PM   #13
 
Recognitions:
Homework Helper Homework Help
I think Facebook uses server-side resizing. It's easy when they host the images themselves. That could be done for attachments on PF, but not for [img] tags.

Anyway, I know there have been threads on this topic in the past - I think I remember suggesting a pure CSS solution one time. Given that the overlords (admins :-P) haven't implemented it, I'm sure they have their reasons, whether it's a matter of being busy or whatever.
 
New Reply
Thread Tools


Similar Threads for: Possible new feature?
Thread Forum Replies
Suggestion A new feature. Forum Feedback & Announcements 2
New Rating Feature General Discussion 5
Editing Feature Forum Feedback & Announcements 4
New Feature! Forum Feedback & Announcements 8
New PM feature Forum Feedback & Announcements 0