Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - New addition, resize images
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

New addition, resize images

 Post Reply Post Reply Page  <12
Author
Dergal View Drop Down
Groupie
Groupie


Joined: 21 January 2002
Location: United Kingdom
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dergal Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2003 at 7:57am

Yeah, but one target audience is the idiots out there who can't resize images... which is why ASPjpeg is used by us on our "ecommerce" images applications...  maybe I will look at doing a mod thing...

Back to Top
jack View Drop Down
Newbie
Newbie
Avatar

Joined: 17 April 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote jack Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2003 at 11:24am
can anyone please show me where the image tags are generated?

I cannot for the life of me find them, and I am pretty good with code.

I removed sections and it had no effect whatsoever.

-jack
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2003 at 5:45pm
Originally posted by Dergal Dergal wrote:

Yeah, but one target audience is the idiots out there who can't resize images... which is why ASPjpeg is used by us on our "ecommerce" images applications...  maybe I will look at doing a mod thing...

I have been looking for a way to do that for a long time, But theres no way I am spending $450 for it.

anyone know where to get somthing free that will do this

 

Back to Top
jack View Drop Down
Newbie
Newbie
Avatar

Joined: 17 April 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote jack Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2003 at 7:28am
<script language="JavaScript">
//-------------------------SCRIPT------------------------
//Make graphic fit in to specified space

function makeFit(theImg, maxW, maxH){
var oldH, oldW, chngH, chngH
oldH = theImg.height;
oldW = theImg.width;
chngW = oldW/maxW;
chngH = oldH/maxH;
if (maxW < theImg.width) {
if(chngW > chngH) {
theImg.width = maxW;
}
else if(chngH > chngW){
theImg.height = maxH;
}
else {
theImg.width = maxW;
}
}
}
//-->
//-------------------------------------------------
</script>


<img src="fridge.gif" onLoad="makeFit(this, 100, 100)">

Please someone show me where the image tags are generated so I can try and implement this.

-jack
Back to Top
Dergal View Drop Down
Groupie
Groupie


Joined: 21 January 2002
Location: United Kingdom
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dergal Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2003 at 7:58pm

 

you mean the images that are in the posts (clue there) there in the POSTS so the tags are stored in the DB! HTH's

As for ASPjpeg, quite a few companies have this or the serverobjects equivalent installed... besides how long before were all going to be using .net?  http://www.serverobjects.com/products.htm#aspimage

Gerry

 

Back to Top
jack View Drop Down
Newbie
Newbie
Avatar

Joined: 17 April 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote jack Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2003 at 6:58am
Any way to catch all <img> tage coming in to the post and add the resize function?

-jack
Back to Top
Dergal View Drop Down
Groupie
Groupie


Joined: 21 January 2002
Location: United Kingdom
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dergal Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2003 at 12:27pm
possibly using a replace function, but it would be complicated... not too sure about any more info than that... G
Back to Top
rephlektiv View Drop Down
Newbie
Newbie


Joined: 12 July 2003
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote rephlektiv Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2003 at 3:22pm

SOLUTION:

Thank you Jack for posting that JavaScript.

File To Edit: forum_posts.asp

Do a search for "<!-- Message Body" (around line 754)

Insert the following line above it:

strMessage=Replace(strMessage,"<img ", "<img onLoad=" & Chr(34) & "makeFit(this, 600, 600)" & Chr(34))

Then add to the top of the page:

<script language="JavaScript">
//-------------------------SCRIPT------------------------
//Make graphic fit in to specified space

function makeFit(theImg, maxW, maxH){
var oldH, oldW, chngH, chngH
oldH = theImg.height;
oldW = theImg.width;
chngW = oldW/maxW;
chngH = oldH/maxH;
if (maxW < theImg.width) {
if(chngW > chngH) {
theImg.width = maxW;
}
else if(chngH > chngW){
theImg.height = maxH;
}
else {
theImg.width = maxW;
}
}
}
//-->
//-------------------------------------------------
</script>

This will limit the width + height of images to 600x600 pixels in the forum threads to prevent the table size from expanding. Modify the (this, 600,600) to set your own max amounts.

Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.