Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

resize images on upload

Posted on 2011-02-17
7
Medium Priority
?
830 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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 1000 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The goal of the tutorial is to teach the user how to make his/her own presets while editing so it is easier to edit there photos. Create a preset you like and copy that setting then save it in to your presets folder.
The goal of the tutorial is to teach the user how to use import presets downloaded from the internet into Adobe Lightroom. Once you downloaded the presets go into the preset folder and press import then import your preset and your set it to go.
Suggested Courses

660 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