php forum
php mysql forum
php mysql smarty
 
Topic Options
#58132 - 05/21/06 04:55 PM Automatically limit inline images to 640 wide
Painfool Offline
Member

Registered: 08/14/00
Posts: 182
With more and more people jumping on the Digital Camera bandwagon... and 6 megapixel cameras cranking out 2100 pixel plus pictures, is there an easy way to automatically display images larger than 640pixels as a 640 thumbnail that links to the image?

I saw the Thumbnail Mod, but it didnt work for me, got some $Returner errors ... but even if it did work.. that would mean educating people on when to use the THUMB code. I'd prefer if it just did it for them smile

Thanks for your consideration!

Top
#58133 - 05/21/06 05:05 PM Re: Automatically limit inline images to 640 wide
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Could be slightly dangerous; if you edited the image code, any image SMALLER than 640 would be enlarged... Immagine that 20px smily displaying as 640x480 lol...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#58134 - 05/21/06 10:20 PM Re: Automatically limit inline images to 640 wide
Painfool Offline
Member

Registered: 08/14/00
Posts: 182
Yeah, I had considered that already smile So Im hoping Ian has something up his sleeve hehe

Top
#58135 - 05/22/06 07:16 PM Re: Automatically limit inline images to 640 wide
Ian Spence Offline
Master Hacker

Registered: 01/25/03
Posts: 3765
Loc: Saint Johns, PA
ugh, it'd require javascript since IE hates max-width

something like

Code:
function fix_images( max_width ) {
	var images = document.getElementsByTagName( "img" );
	var i = 0;
	for( i = 0; i < images.length; i++ ) {
		var img = images[i];
		if(  img.width > max_width && img.alt == "-" ) {
			var new_height = img.height * ( max_width / img.width );
			img.width = max_width;
		}
	}
}


Top



Moderator:  Gizmo 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks