locked
image resizing RRS feed

  • Question

  • User-576119581 posted

    Hi,

    In my web app i'm uploading pictures of employees and I need to resize the images while maintaining the same quality.  The best example I can think of is the way facebook does their image resizing.  When you upload a profile picture...the picture shown in your profile page isn't the full size...i tried to find an algorithm that would work but am having no luck. 

     Any ideas?

     Thanks

    Wednesday, June 10, 2009 5:08 PM

Answers

  • User-925286913 posted

    If your algorithm stores it with name "test.jpg" in image folder then use:

    Image1.ImageURL = "~/image/test.jpg"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 12, 2009 2:55 PM

All replies

  • User404249694 posted

     private string createthumbnail(string originalimage, int resizewidth, int resizeheight)
        {

            string ImgThumb ="path you like to save"    
            string imgFileName = System.IO.Path.GetFileName(originalimage);
            System.Drawing.Image myimg = System.Drawing.Image.FromFile(originalimage);
            myimg = myimg.GetThumbnailImage(resizewidth, resizeheight, null, IntPtr.Zero);
            myimg.Save(ImgThumb + imgFileName, myimg.RawFormat);
            string path = ImgThumb + imgFileName;
            return path;
        }

    Thursday, June 11, 2009 2:09 AM
  • User1608535991 posted

    Hello j2flk,

    Here is one of the best solutions I could find on the Internet.

    http://www.codeproject.com/KB/GDI-plus/imageresize.aspx?display=Print 

    Also, please check my thread http://forums.asp.net/t/1433678.aspx . If you implement this solution and you find a resolution for my problem, please post it on my thread. Good luck!

     

    Thursday, June 11, 2009 3:47 AM
  • User-576119581 posted

    Hey Guys,

    Thanks for your help....i'm just going to go with a solution I found in ASP.NET 3.5 Social Networking....it's a pretty simple solution but if anyone is curious as to what it is then just let me know and i'll post it.

     One problem I am encountering however is that I want to resize on the fly....the problem with this is that to display my image i'm using asp Image.  My algorithm creates a bitmap however...and i don't know how I can assign this bitmap to the asp image.  Any ideas?

    Thursday, June 11, 2009 3:47 PM
  • User-925286913 posted

    If your algorithm stores it with name "test.jpg" in image folder then use:

    Image1.ImageURL = "~/image/test.jpg"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 12, 2009 2:55 PM
  • User1287880341 posted

     Hi j2flk,

     

    Can you post your simple solution. I am trying ro resize an image according to the size of the browser window. Maybe it can help

     

    Thanks and regards,

    Dani

    Monday, June 15, 2009 8:09 AM
  • User-1705102389 posted

    Hi,

    In my web app i'm uploading pictures of employees and I need to resize the images while maintaining the same quality.  The best example I can think of is the way facebook does their image resizing.  When you upload a profile picture...the picture shown in your profile page isn't the full size...i tried to find an algorithm that would work but am having no luck. 

     Any ideas?

     Thanks

     

     

    There is a great site for resizing your images without affecting the quality of the image. It is: http://www.reshade.com . You can Enhance, crop and resize images for free with the high quality online image resizer.

    The Photo Enlargement Software at this site is the most accurate photo enlargement method for your PC. It would sure give you a Best quality image resizing, better than photoshop or other tools. Compared to other photo enlargers on the market Reshade works best at any zoom not only specific ranges (1x-4x, 3x-5x etc).

    You can check it out at: http://www.reshade.com

     

    Saturday, July 4, 2009 9:04 AM
  • User-1144947630 posted

    Try to use this picture resizing tool http://www.softorbits.com/batch_picture_resize/ It works well!

    Tuesday, June 1, 2010 6:13 AM
  • User1792244448 posted

    The poster asked for a dynamic resizing solution, not a batch resizing solution.

    There is a free and open-source HttpModule for resizing and processing images, which should be exactly what you were asking for.

    See imageresizing.net/ for installation instructions. It's extremely simple and is an easy way to avoid the image resizing pitfalls that everyone seems to make.

    Hope this helps!

    Nathanael Jones

    Tuesday, May 3, 2011 6:32 PM