Forum Moderators: open

Message Too Old, No Replies

image resizing

         

Sarah Atkinson

8:35 pm on Apr 29, 2008 (gmt 0)

10+ Year Member



I am pulling invintory from a DB. I am using the first photo in a list as the thumbnail. It is sized down in the html but looks realy bad. Is there anyway to improve the look of the photo without creating a new smaller sized file to draw from?

thecoalman

9:21 pm on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Unless there is some javascript I'm not aware of you need to resize it beforehand. I don't know how browsers scale images but it must be through a simple removal or addition of pixels method. To get it to look good it needs to be processed using a good method like bicubic.

penders

9:38 pm on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is sized down in the html but looks realy bad.

Opera actually does a really good job of resizing/resampling images in the HTML.

SuperKitten

1:09 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



In fact, unless some resizing work beforehand, the image will look 'normal' only when the original width and height are specified accurately within the <img> tag

Now, if you really have to resize a huge amount of pictures, i would advise you to use a free program like Fastone PhotoResizer. I am not here to promote them, but they have done a very good job with this program. And by outputting your images to .jpg format, you will probably save up to 80% of their weight, with no noticeable loss in quality

Sarah Atkinson

2:00 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



I figured out a way around this.. Although I don't know how it works.
I the files are stored on another company's server . We pay them a monthly fee for storing our pictures. Somehow they have a .ashx page that you can put the parameters of the file name and the new image width in as http://Theirsite.com/Thumbpic.ashx?File=filename.jpg&Size=133

this makes the thum look great. I'd like to know how it works... any ideas?

What is a .ashx file?

[edited by: jatar_k at 3:14 pm (utc) on April 30, 2008]
[edit reason] delinked [/edit]

thecoalman

4:19 am on May 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not familiar with what you mentioned but what they are doing is resizing it server side. You can use GD or Imagemagick to do this. Your server may or may not have these installed and you'll have to use a scripting language like php to utilize it. Most servers with php will have the GD library available.

?File=filename.jpg

This is the first variable sent to the script, it simply tells it what file.

&Size=133

This tells it the size, it gets resized by the server and sent to the client. There's many web application that make use of this but most store the thumbnail after creation so it doesn't have to be created again. Two typical things that will do this are image galleries and e-commerce software for products.

penders

7:45 am on May 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is a .ashx file?

From filext.com:

ASP.NET Web Handler File

A web handler file works just like an .ASPX file except you are one step back away from the browser level where HTML and C# mix.