Solved

Creating thumbnail on the fly

Posted on 2000-04-10
11
302 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
  • 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
 

Author Comment

by:Darrick
ID: 2701752
M

Could you explain?

Darrick
0
 

Author Comment

by:Darrick
ID: 2701771
M

Could you explain?

Darrick
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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 the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

757 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

19 Experts available now in Live!

Get 1:1 Help Now