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
Solved

resize images on upload

Posted on 2011-02-17
7
805 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The goal of the tutorial is to teach the user the full work flow of how to use flash media encoder to stream onto YouTube.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

861 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