Author |
Topic |
ugger
Junior Member
Denmark
127 Posts |
Posted - 13 November 2008 : 11:32:42
|
Hi In my forum it is only allow to upload jpg-files to the photoalbum. I've set a limit to the file-size to 100 kb but the photo-files can easily be compressed to 10-30 kb pr.image with f.e. photoshop. Now it's getting close to be a hard job to compress all the imagefiles that the users are uploading. I would like to know if anyone in here knows how to make this done automatically. I've hear about some software called "clsimage.???" that should be able to do the work, but is it usable together with snitz-software? Thanks all for a very great software. < |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 13 November 2008 : 11:59:31
|
I do image compression on my MOD using ASPJpg component that we can have in shared hosted environments, a part of that all you need is to code / modify a little the PhotoAbum MOD.
I use this little code to compress the image into a JPG with 90% quality and reduce the size to fit the Avatar MOD
destinationFile = un & "." & convertTo
Set Jpeg = Server.CreateObject("Persits.Jpeg")
With Jpeg
.Open server.MapPath(image_ref)
.Canvas.Brush.Color = &HFFFFFF
.Crop x, y, width + x, height + y
.Quality = 90
.Width = 96
.Height = 96
End With
' save croped image to hard drive
Jpeg.Save server.MapPath(AVATAR_PATH) & "\" & destinationFile
set Jpeg=nothing < |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 13 November 2008 12:02:34 |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
ugger
Junior Member
Denmark
127 Posts |
Posted - 13 November 2008 : 12:15:50
|
Actually I dont mind paying somthing, but where and how am I suppose to intergrate the software as the ASPJpg with the snitzsoftware< |
Edited by - ugger on 13 November 2008 12:16:16 |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 13 November 2008 : 14:01:33
|
I'm not familiarized with the PotoAlbum Mod code but you need to find the code that saves the image into the server folder and apply my code there first, you can remove the width and height if you are not resize it.
send me an email with your forum and source code, I can help you if you need.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
ugger
Junior Member
Denmark
127 Posts |
Posted - 13 November 2008 : 15:10:16
|
Thanks, but how do I email this to you, the emailsystem in Snitz does not allow fileattachments.< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 13 November 2008 : 15:17:53
|
Put it all in a .zip file and either send the link or post it here. If you post it, make sure you remove your database connection information and anything else of that nature. < |
|
|
ugger
Junior Member
Denmark
127 Posts |
Posted - 13 November 2008 : 15:44:59
|
it's a whole lot of codelines, but it has to be in this asp-codes. I presume you have these codes.
photo_album_upload.asp inc_photo_album_functions.asp ToFileSystem.asp clsImage.asp clsProgress.asp clsUpload.asp< |
Edited by - ugger on 13 November 2008 15:45:37 |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 13 November 2008 : 18:06:25
|
ok, just give me the Mod link then :) I will work from there
and check if you have the component installed in your server / shared hosting company.
To check that just create a new file and called testComponent.asp and add the code:
Set Jpeg = Server.CreateObject("Persits.Jpeg")
response.write( Jpeg.version )
save it, upload it and test it (run the page)
and tell me wht do you want to do, for example, you can tell the users to upload a photo but the system will reduce image quality while the photo have more than 40Kb... so, a photo of 800x600 that have a size of 70kb with 20% compression, would have 40kb using 60% compression.
< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 13 November 2008 18:19:19 |
|
|
ugger
Junior Member
Denmark
127 Posts |
Posted - 14 November 2008 : 04:12:07
|
I get this result from testcomponent.asp
Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed /testComponent.asp, line 2
What I want to do is that images with a width more than 500 pixels is reduced to 500 pixels It is vital that the images's proportions still is right. Images with a width less than 500 pixels is not to be changed. Then the images has to be compressed with what Photoshop calls medium compression.
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp. < |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 November 2008 : 07:41:27
|
So, you will have a problem, that component does not exist in the server.
It that your server or a hosting solution? if it is yours, you need to buy the component, if you have the forum in a hosting solution, check the ASP components and tell me one that for images that they have installed.
About of what you want, tat is pretty easy to do.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 November 2008 : 07:44:49
|
quote: Originally posted by ugger
Thanks, but how do I email this to you, the emailsystem in Snitz does not allow fileattachments.
Think out of the box! there are a thousand ways to put the zip file in the web and paste the URL in the email! you can use your own account to upload the file, you can use SkyDrive from Microsoft, you can use ... there are so many!
P.S. you still didnt provide me with the Mod link!< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 14 November 2008 07:46:01 |
|
|
ugger
Junior Member
Denmark
127 Posts |
Posted - 14 November 2008 : 08:02:29
|
I will ask my serversupport!
bliv nu ikke for emsig, du da vel selv snitzsoftwaren IKKE! sorry,missing tranlastion here it comes
Don't get too smart, you do have the Snitzsoftware, right?
< |
Edited by - ugger on 15 November 2008 07:11:29 |
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 November 2008 : 10:29:12
|
Hi David,
I knew wre the Mod was, but I needed with all the plug ins that Henrik has, and by the way, the Mod mention AspJpeg component so I guess it is easier to do but thanks anyway David < |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 November 2008 : 10:36:46
|
Thanks David,
I knew where it was, but I wanted the exact version and addons that Henrik uses... but thxs anyway David
@Henrik:
first of all, you should always write in english or at least have a translation in english so everyone can see and read, and that is a stupid think to say cause I just wanted to help you! I am so glad that I'm not Danish! You are extremely rude!< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 14 November 2008 10:37:38 |
|
|
Topic |
|