ASPImage sux! (apparently)

Discussion in 'H-Sphere Shared Hosting' started by Logan, Nov 4, 2004.

  1. Logan

    Logan Perch

    My site has been using ASPImage for a long time. Recently, Yash and I have been exchaning messages on the amount of RAM my site was using. JH staff have been recycling my site in an attempt to minimize the amount of RAM used by my site. To my knowledge, this has only impacted the effort required by JH admin's and have not caused adverse affects on other sites.

    My site has an average of 65000 page hits/day, 85000 hits/day and traffic of 280M/day. ASPImage was being used a lot.

    I just recently switch from ASPImage to ASPJPEG. The actual changes in code were minimal and easy to make. Apparently this change has totally eliminated the RAM usage problem. This suggests to me that ASPImage basically sux. (If I had known that ASPImage was the cause of such a problem, I would not have used it in the first place.)

    I urge everyone to not use ASPImage and use ASPJPEG instead. This will help ensure stability of the JH servers and allow the JH admins to look into and resolve more serious problems.

    As to a guide to switching, here are the changes to my code:

    server.createobject("aspimage.image") becomes server.createobject("persits.jpeg")
    i.loadimage becomes i.open
    i.loadblob becomes i.openbinary
    i.maxy becomes i.originalheight
    i.maxx becomes i.originalwidth
    i.resizer becomes i.width = x and i.height = y
    i.cropimage x,y,w,h becomes i.crop x1,y1,x2,y2
    i.fontname becomes i.canvas.font.family
    i.bold becomes i.canvas.font.bold
    i.fontcolor becomes i.canvas.font.color
    i.threedcolor becomes i.canvas.font.shadowcolor and i.canvas.font.shadowxoffset = 1 and i.canvas.font.shadowyoffset
    i.textangle becomes i.canvas.font.rotation
    i.italic becomes i.canvas.font.italic
    i.fontsize becomes i.canvas.font.size
    i.textout copytext becomes i.canvas.printtext

    More details about the methods and properties of ASPJPEG can be found at http://www.aspjpeg.com/objectreference.html.

    I hope this helps make your conversion to ASPJPEG
  2. snooper

    snooper Perch

    thanks for the pointers.
    i agree ASPjpeg is much better. Thanks again to JH for adding it a few months back
  3. Yash

    Yash Bass

    I am converting this into a sticky for everyone.
  4. Logan

    Logan Perch

    I get my own sticky? Don't I feel special :)
  5. Nathan

    Nathan Perch

    Love it. Thanks, I've been playing with AspJpeg and Upload today. Really easy to use and very powerful.

    Just a question though, what version is on the JH server as I would like to add the progress bar and I think only ver 3 suports it.

    Nathan
  6. Stephen

    Stephen US Operations Staff Member

    The help doc I just opened said 1.3, but the DLL version infomation says 1.4.0.1, I dont even see a 3.0 at aspjpeg.com

    Edit: I just reread, I think you may have meant aspupload version, it is 3.0.0.3
  7. Nathan

    Nathan Perch

    Sorry yes I did Stephen. That's good news, I'll try adding the progress bar.

    I've just added a new system to display my members galleries in thumbnails - this will save me loads of bandwidth, but I am concerned that it puts extra demands on the server.

    I am creating the thumbs when a page is requested and using send_binary file. This creates and sends the thumb to the browser. Works perfectly, but if a page consists of 100 pictures, there is a lot of processing for the server. How concerned should I be - I don't want to upset anyone!

    Thanks

    Nathan
  8. Stephen

    Stephen US Operations Staff Member

    We will sendyou a warning if it is using too much CPU, hopefully it won't.
  9. SubSpace

    SubSpace Bass

    It would probably be better to generate the thumbnails when you add the image to the gallery.
    If that isn't an option because you just upload images to some directory, you could expand on your current thumbnail creation script to save the thumbnail result to a file as well as send it to the browser. Next time, check if the file is present (and maybe compare filedates). If the thumbnail is present and up to date, use the file.

    Should save a load of CPU time.
  10. Nathan

    Nathan Perch

    Great idea, thanks SubSpace, I'll give it a go.
    I love the features that ASPImage offers me and it's so easy to use.
    Cheers

    Nathan
  11. Logan

    Logan Perch

    I do something similar and my site serves up 40,000+ thumbnails on average every day. To my knowledge this does not cause load problems on JH's servers, at least since I switched to ASPJPEG. However I have restricted my pages to display no more than 15 thumbnails per page.
  12. Nathan

    Nathan Perch

    My new gallery is working great. Thanks to Logon for his suggestion.

    But, I have a small problem.

    To show the galleries, I am using the File System Object:

    set fs = CreateObject("Scripting.FileSystemObject")
    set folder = fs.GetFolder(path)

    for each item in folder, show thumbnail


    This lists the pictures alphabetically, whereas I need to list them by date. I cannot see any obvious way of doing this.


    Very greatful for any help.

    Nathan
  13. tr1stan

    tr1stan Perch

    Hi Nathan,

    I think you are going to have to put all the items into an array, sort by specific column and then output!

    Something like:

    Code:
    set fs = CreateObject("Scripting.FileSystemObject")
    set folder = fs.GetFolder(path)
    DIM arrSections(), x, file
    
    x=0
    for each file in folder
    	redim Preserve arrSections(2, x)
    	arrSections(0, x) = stuff with file path
    	arrSections(1, x) = stuff with file date
    	x=x+1
    next
    then check this link
    for how to sort the array!

    T
  14. Nathan

    Nathan Perch

    Thanks Tristan, I thought as much.
    Currently, I am adding them to a record set, then using the built-in function to sort them. It just seems an un-neccessary overhead for the server though. Fortunately, I am managing to run the script only occasionally - when a new web cam image or photo is added to the gallery, so those on win5 shouldn't notice any delay! :rolleyes:

    Cheers

    Nathan
  15. Nathan

    Nathan Perch

    I am now trying to futher inmpove my webcam and gallery system (to help reduce server load)

    When displaying the thumbnails of the webcam, I would like to be able to save them to file, to prevent the constant use of the Server.CreateObject("Persits.Jpeg") object. Code as follows:


    <img border="1" src="/webcams/send_thumb_binary.asp?path=/webcams/jetty_pics/<% =item.FileName %>"


    How can I check before I call the binary file to see If the thumb already exsists (and thus if it does, just show the thumb jpg), else call the binary file to make a thumbnail and save it to a 'thumbs folder'. I can do all the programming to show the pic or make the thumb, but I'm having problems trying to get the system to detect if the thumb has already been made.

    Any help of advice would be very welcome.

    Nathan

    www.agni.gr
  16. snooper

    snooper Perch

    Try with FSO - IfExists
  17. Nathan

    Nathan Perch

  18. Mon1018

    Mon1018 Guppy

    Thanks for the info.
    I'll check the link.:)

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services