resize images on upload

Hi experts,

I'm trying to rezise images when my client uploads them

I found a piece of code that works in asp:

  Sir = Server.CreateObject("SfImageResize.ImageResize")
        Sir.LoadFromFile(dirpath & "\" & filename)

        If (filewidth / fileheight) > (max_width / max_height) Then
            Sir.Width = max_width
        Else
            Sir.Height = max_height
        End If

        Sir.DoResize()
        Sir.SaveToFile(dirpath & "\" & final_filename)

        Sir = Nothing

but I get:

Could not create an object of type 'SfImageResize.ImageResize'.

Can anybody help?

thanx

p.s. I'm working in vwd 2008  + vb
nuritatAsked:
Who is Participating?
 
JermTheWormConnect With a Mentor Commented:
Umm you need to do what it tells you:
<%@Page ASPCompat="true" %> 

Open in new window

needs to be added at the top of your aspx file
see this link for more info : http://msdn.microsoft.com/en-us/library/ms973813.aspx
0
 
JermTheWormCommented:
That's because SfImageResize is a third party library you probably don't have? http://www.silberfish.com/sfir/ (free for personal use)
0
 
nuritatAuthor Commented:
does it have to be installed also on the hosting server?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
JermTheWormCommented:
I guess yes, Would that be considered free for personal use??
0
 
JermTheWormCommented:
Also see this it's c# but I'm sure it can be translated.
0
 
nuritatAuthor Commented:
Hi,

I"m sure the component should be on the server as it worked before (for the previous developer)
but now I get :

"The component 'SfImageResize.ImageResize' cannot be created. Apartment threaded components can only be created on pages with an page directive."
0
 
nuritatAuthor Commented:
Thank you very much, it works now
0
All Courses

From novice to tech pro — start learning today.