Print Page | Close Window

New addition, resize images

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=914
Printed Date: 02 April 2026 at 4:58am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: New addition, resize images
Posted By: bramseltje
Subject: New addition, resize images
Date Posted: 11 March 2003 at 8:28am
Well, since I am not able to post in the skins and mods forum, I will have to place it here.

Because of the need there was on my site, I tried to develop something to resize images easily. The way I wanted to be able to do this is by using the [ img] tags, but they have no way of adding the size of an image. So I added the [img=height,width] tags to my forum to be able to do this [=D>]

If there is any interest, I will try to create a usable update to the forum. The version I wrote this for is version 6.34 by the way, but I guess the way v7 uses the format_post and edit_post include files is pretty much the same, so it probably van be use with that one too.

If anyone is willing to test it, just mailto:b_cramer@hotmail.com - email me...

As it stands now, I do have the files isolated that need to be updated (just 2 of them) so if anyone wants to be able to give their users this extra feature, just leave a message here...

Right now I'm gonna test it with version 7, so expect an update within the hour...



Replies:
Posted By: bramseltje
Date Posted: 11 March 2003 at 12:35pm
Update!
I have also managed to implement this feature in v7.beta3!

It is not as similar to the old version I hoped, so it took quite some time to actualy find out how it would work...

But it's done, so if anyone is interested (if I see how many reactions I've had, I dare doubt it...) you're welcome to drop a line...


Posted By: jack
Date Posted: 17 April 2003 at 1:02pm
Can you tell me where the image tag is generated for the actual post area? I am trying to add some code to call javascript functions to the image tags, but cant seem to find the exact place that they are generated. I tried a few files, with no luck.

-jack


Posted By: jack
Date Posted: 17 April 2003 at 1:16pm
version 7.4


Posted By: jack
Date Posted: 17 April 2003 at 2:05pm
need to make the image tag look like this

<img src="." onLoad="Resize(var, xx, yy)">


Posted By: Dergal
Date Posted: 18 April 2003 at 5:23am

Would be VERY cool to truly resize them, possibly using ASPjpeg, something that would make it upload a smaller image size for people who think that uploading a 300kb image file is a good idea...

</thoughts>

Gerry



Posted By: jack
Date Posted: 18 April 2003 at 6:06am
if someone could help me find the image tags, i might be able to make "some" progress on this.


Posted By: xeerex
Date Posted: 18 April 2003 at 6:47pm

You can limit the file size of images in the admin, Dergal. If someone were to upload a 300KB image then the admin must have thought it a good idea.

Bram, I have a test forum on my home server that I'd be willing to try your mod. Why don't you post the mod as a zip file?



-------------
http://webspacegeeks.com - Need Hosting, Domains, Dedicated Servers?
http://www.smartergeek.com - web design | pc support | training | podcasts | video production


Posted By: Dergal
Date 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...



Posted By: jack
Date 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


Posted By: vdub
Date 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

 



-------------
http://www.CyberCPU.net - Hardware reviews, Forum, Free advertising!!!!


Posted By: jack
Date 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


Posted By: Dergal
Date 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 - http://www.serverobjects.com/products.htm#aspimage

Gerry

 



Posted By: jack
Date 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


Posted By: Dergal
Date 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


Posted By: rephlektiv
Date 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.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net