Solved

resize images on upload

Posted on 2011-02-17
7
802 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:nuritat
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

by:JermTheWorm
ID: 34915583
That's because SfImageResize is a third party library you probably don't have? http://www.silberfish.com/sfir/ (free for personal use)
0
 

Author Comment

by:nuritat
ID: 34915763
does it have to be installed also on the hosting server?
0
 
LVL 5

Expert Comment

by:JermTheWorm
ID: 34915868
I guess yes, Would that be considered free for personal use??
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 5

Expert Comment

by:JermTheWorm
ID: 34915877
Also see this it's c# but I'm sure it can be translated.
0
 

Author Comment

by:nuritat
ID: 34937093
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
 
LVL 5

Accepted Solution

by:
JermTheWorm earned 250 total points
ID: 34941998
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
 

Author Closing Comment

by:nuritat
ID: 34942421
Thank you very much, it works now
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now