1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

ASP Resize image on upload - script?

Discussion in 'C#' started by Design1, Jun 23, 2007.

  1. #1
    Hey guys!
    I am working on a project and I have programmed the backend of a site. The user is able to add/edit content and photos. The problem is, they want to take photos that they have taken with their camera and upload them to their site. They don't know much about computers, let alone how to properly resize a photo (both lxw and file size). Does anyone know of a script I could use to implement into my existing code to take care of this?

    Thank you very much!
    Rene
     
    Design1, Jun 23, 2007 IP
  2. smrtime

    smrtime Active Member

    Messages:
    289
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    58
    #2
    smrtime, Jun 23, 2007 IP
  3. ccoonen

    ccoonen Active Member

    Messages:
    1,594
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    90
    #3
    asp.net 2.0 has some hardcore image manipulation right inside it. You can upload a photo, change it's hue, size, contrast, etc... Lots to play with in System.Drawing namespace ;)
     
    ccoonen, Jun 25, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,682
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    With .Net it is very easy and is basically just .GetThumbnailImage

    When you save the file, make sure you specify the image format otherwise the file size is massive (took me ages to work it out)
     
    AstarothSolutions, Jun 28, 2007 IP
  5. Design1

    Design1 Active Member

    Messages:
    388
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    78
    #5
    Thanks anyhow but I found an incredible little component called sfimageresize for only $35. It did exactly what I needed it to do, so I would highly recommend it for anyone that may have my same needs. While you do have to register it on your server and it's not free, it was really easy to configure and no one knows it's there. :)
    Now my problem is that they will need to rotate the images that may be taken portrait instead of landscape. If anyone has any suggestions, I would greatly appreciate it.

    As for .net i'm trying to decide between that and php at this point.
     
    Design1, Jun 28, 2007 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,682
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ASP.Net can do it out the box with only 3 lines of code so components not really worth paying for.
     
    AstarothSolutions, Jun 29, 2007 IP
  7. Design1

    Design1 Active Member

    Messages:
    388
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    78
    #7
    asp.net sounds like a lot of fun and very beneficial as well. Where would you recommend to start off in the learning process for it?
     
    Design1, Jun 29, 2007 IP
  8. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,682
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #8
    In 99% of cases what works in classic ASP will also work in .Net which makes making the transition easy.

    The "problem" is that this is really a double edged sword as whilst it does work it is by no means as efficient as "proper" .Net either in terms of coding time nor run time but it is very easy to slip back to old habits.

    I personally am first and foremost a project manager and leave the proper development to our developers. I have done some ASP in my time (mainly self generated elements in DreamWeaver with some tweaking) and have since moved on to doing .Net for my hobby sites. I used a book on ASP.Net as a grounding (the 4 dummies one) but to be honest it didnt really describe enough about the concepts of .Net and object orientated programming which you need to understand to get the most out of .Net.

    I could create what I needed but since understanding OOP better it has generally halved the amount of code I need and reduced the time to develop by a 3rd but still my own stuff is bloated compared to our developers
     
    AstarothSolutions, Jun 29, 2007 IP
  9. Aztral

    Aztral Active Member

    Messages:
    344
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    75
    #9
    Just wanted to add that I recently did a photo gallery site. To solve this problem I didn't resize the image with ASP, but with javascript on the output. This way original image was preserved.



     
    Aztral, Jul 9, 2007 IP
  10. MasterOfLogic

    MasterOfLogic Active Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #10
    http://aspnet.4guysfromrolla.com/articles/012203-1.aspx

    here's a good article from Microsoft MVP scott mitchell. This is one way you could go about it in .net. I've used this example myself.
     
    MasterOfLogic, Jul 12, 2007 IP
  11. KowDot

    KowDot Peon

    Messages:
    296
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #11
    This is fairly simple with a few lines of code in ASP.NET 2. I'm doing it on my site (see sig). Let me know if you want some help.
     
    KowDot, Jul 12, 2007 IP
  12. dizzy

    dizzy Peon

    Messages:
    43
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #12

    That's not a good idea because the page might be very slow if you upload large size images in the gallery.

    If you have 15 images in the gallery that average 200kb each..that's 3MB the user will have to download just to load the gallery. Most users will leave if the site takes too long.

    If you have thumbs that average 8kb each..then it's only .12 MB.


    ASP.NET is the way to go..many things that are time consuming in ASP is easy in ASP.NET
     
    dizzy, Jul 16, 2007 IP
  13. Design1

    Design1 Active Member

    Messages:
    388
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    78
    #13
    Thanks a lot for your input. I'm going to give ASP.Net a shot and hope for the best. I noticed that when i changed some of the file names to .aspx instead of .asp, my original .asp code still worked. That's a very good sign! From what i have read it sounds as if there are a lot of benefits to upgrading my asp knowledge to the .Net version.
     
    Design1, Aug 28, 2007 IP
  14. AndyFarrell

    AndyFarrell Peon

    Messages:
    90
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #14
    asp.net it hot.
    i made this site digitallypainted.com/ with asp.net, i think it was one of the first project that tested my skills an an asp.net developer.

    The site is powered by a c++ dll from a desktop application, i imported the functions from the c++ dll then use ajax to get the slidebars n shit working without reloading.

    this is my Captcha
    letzshare.com/Captcha.aspx its so sexy lol


    another thing if anyone need ebooks or video on asp.net or anything please contact me. 100% free. but a backlink to one of my site will be nice :(
     
    AndyFarrell, Aug 28, 2007 IP
  15. ashrafweb

    ashrafweb Member

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #15
    ASP.NET is the way to go..many things that are time consuming in ASP is easy in ASP.NET
     
    ashrafweb, Sep 14, 2007 IP
  16. frances

    frances Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #16
    If you want decent quality/small file size resizing of images, getthumbnail isnt the way to go. It creates big fuzzy images. You can get better results by playing around with GDI+
     
    frances, Sep 15, 2007 IP