Solved

resize images on upload

Posted on 2011-02-17
7
800 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
Comment Utility
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
Comment Utility
does it have to be installed also on the hosting server?
0
 
LVL 5

Expert Comment

by:JermTheWorm
Comment Utility
I guess yes, Would that be considered free for personal use??
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

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

Author Comment

by:nuritat
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you very much, it works now
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article provides the solution to a question (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28674207.html) posed here at Experts Exchange. The asker of the question has many JPG images in many folders, and all of t…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to count occurrences of each item in an array.
The goal of this is to tech the user how to export photos out of Lightroom and the different options they have. Select which photos you want to export : Select where you want to export and with which options : Export :

743 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

16 Experts available now in Live!

Get 1:1 Help Now