Hi, I am trying to prevent thread assassins in a forum from posting giant images via url.
Is it possible to grab that images size by 'looking at it' when you have the URL?
So I am thinking of disabling the ability to add images and edit HTML in the editor, but have a seperate text input for the URL for the image if they want to add one.
If the above question is possible, the person would think they have added a giant image, but it would be stripped out, and appended with the size attributes added or not at all if the image is huge.
Does that make any sense?
Thanks,
James MacLeod
Controlling an image size pasted via URL??
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
It is possible to grab the image's size, but unless you check it every time you load the page (which is untenable), they could always change it after the initial post. This is the problem with external avatars. The (usual) way is just to force users to always upload images.
Adding size attributes would cause problems if the image was smaller than what you wanted. Maybe with some clever CSS you would be able to make sure that the image doesn't spill out (maybe overflow or clip). Software like MediaWiki have skins that really aren't affected too badly by text that stretches out far.
Adding size attributes would cause problems if the image was smaller than what you wanted. Maybe with some clever CSS you would be able to make sure that the image doesn't spill out (maybe overflow or clip). Software like MediaWiki have skins that really aren't affected too badly by text that stretches out far.