Solved

Creating thumbnail on the fly

Posted on 2000-04-10
11
327 Views
Last Modified: 2010-04-06
I would like to display a thumbnail as a link to a full size image, without creating a thumbnail using an image editor or loading the full sized file.  Is this possible?
0
Comment
Question by:Darrick
[X]
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
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 2701591
No.

In order to create a thumbnail you need to read the entire file even if you're discarding 3/4 of the data. Remember that images are normally stored in line order. That is the first line of the image is the start of the file and the last line is the end of the file. When you create a thumb at, say, 1/4 the main resolution, you'll skip every other line and discard every other pixel on the lines you do keep. This means to draw the bottom row of the thumb you have to read either the last or next to last line of the full size image to get the bottom row's data. Since you've had to slow thru the entire image anyway, you might as well have shown the full image to begin with as you've sent the whole thing over the wire anyway.

If you're clever, you can cache the image locally once it's been sent the first time and only display the thumb on subsequient lookups, however since both NS and IE already do this there is no noticable speed advantage.

M
0
 
LVL 5

Expert Comment

by:compmania
ID: 2701680
If this is for a webpage sure (if I am reading the question right)
I did it for my graphics at http://computergraphics.8m.com

Just check the source, all you need to do is load the image and tell it to use a smaller image size. (I think I resized my images so they would load faster but I have done it before without doing that)
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701736
Scaling down doesn't speed things up. You're going to read the full file even if you only show 10% of the image. This will make your page appear dog-slow as it will take forever to load a small rectangle.

Perhaps you should look at progressive GIF's and have the low res and high res images cascaded.

M
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Darrick
ID: 2701752
M

Could you explain?

Darrick
0
 

Author Comment

by:Darrick
ID: 2701771
M

Could you explain?

Darrick
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701790
Progressive GIF's store multiple images in a single file. You can have a low rez image as the first thing displayed. It'll be blocky but you'll get an idea of the image before you spend the bandwidth to see the next image in the set.

If you browse with autoload of images turned OFF (set in the preferences of both IE and NS) then all you'll see is the outlines. Then if you select an image and click to see it you'll get the first image in the series. Click it again and you'll get the next image. Sometimes the images are stored with fewer colors than the final or even in B/W.

I don't have a progressive GIF handy to show but that's how they work.

One problem with the .GIF format is that it's a licensed format and you'll have to pay for a .GIF creator or something on the license.

M
0
 
LVL 5

Expert Comment

by:compmania
ID: 2702386
Scaling down does speed things up because of less data, if I have a 480x360 pixel image and change it to a 200x150 it will load faster. I don't think just changing it using html tags will make it load faster.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2702651
Yeah, resizing the data file reduces the amount of data sent over the wire. Having the image resized in HTML leaves the file size alone and just rescales it down for display and sends the WHOLE file over the wire.

M
0
 

Expert Comment

by:Neva
ID: 2706927
As far as I am aware, there is no way to size-down an image--in both data size and image size--without using an image editor.  HTML can be used to scale down the image, but it will STILL BE THE FULL DATA SIZE.  This is NOT a decent option to use.  Your best bet is to download Paintshop Pro or something and use that to scale it down to thumbnail-size.

Hope this helps.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2707632
Neva,

Welcome to E-E!

However please understand that the Experts here at E-E have developed a system where it's considered impolite to post and *Answer* that is very similar to previously posted *comments*. The questioner has the option of accepting any comment as an answer and thus we all tend to post just comments to keep the question open and active. The questioner will then accept whatever comment they feel best helps them.

Please change you answer to a comment to insure that the question is reviewed by other experts.

M
0
 

Author Comment

by:Darrick
ID: 2708344
Neva

Please see above comment from M

Darrick
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

751 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