Solved

GetThumbNailImage and Pics with Thumbnails

Posted on 2003-11-19
7
1,129 Views
Last Modified: 2009-07-29
in this article:
http://aspnet.4guysfromrolla.com/articles/012203-1.2.aspx

he talks about "The problem is that the GetThumbNailImage() method resizes an image from the original image if their is no thumbnail embedded in the image. The problem is, most digital cameras do embed a thumbnail image in the image. "

My question is, if I have one of those camara's, is there any way to display dynamic thumbnails of those embedded thumbnails, or just thumbnails of the images themselves?
0
Comment
Question by:jagoodie
7 Comments
 
LVL 4

Expert Comment

by:Kokoglen
Comment Utility
Actually, in this article is says it always uses the thumbnail, not the original.
http://www.wimdows.net/articles/article.aspx?aid=9

Read the developer thread after the code.

Also, check this out, it really gets into detail from the horses mouth.
http://msdn.microsoft.com/msdnmag/issues/03/07/CuttingEdge/default.aspx
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
right, i just need to figure out how to do this withought having thumbs that look like crap.
0
 

Expert Comment

by:thedrs
Comment Utility
windows can create embeded thumnails.
just set your picture folder in the 'view' menu to 'thumnails', then in 'folder options' set the option that each folder "remembers" it's settings (if it is not set already).
now each time you transfer pics from your camera to this folder, windows will create embedded thumnails which can be used automatically by the asp.
the embedded pictures are actulay using a mechanism called ADS.
if you want to know more about it:
http://www.ebcvg.com/zines/03/NTFS%20Alternate%20Data%20Streams.htm
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Accepted Solution

by:
acorn73 earned 500 total points
Comment Utility
rotate the image 360 degrees and it will remove the embeded thumbnail and use the full size image to create a thumbnail.

fullSizeImg.RotateFlip(RotateFlipType.Rotate180FlipNone);
fullSizeImg.RotateFlip(RotateFlipType.Rotate180FlipNone);
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
now i just need to figure out a way for it to not eat up so much of the processor...
0
 
LVL 1

Expert Comment

by:acorn73
Comment Utility
the easiest way to free the processor is to cache the reduced thumbnail the first time it is created.

thumbnailImg.Save("thumbsFolder\fileName.jpg);


Then when the image page is loaded check the thumbs file for a coresponding image before calling the createThumbnail function

foreach (string s in Directory.GetFiles(Server.MapPath(IMAGE_DIRECTORY), "*.jpg"))
{
       thumbsFilePath = "thumbsFolder\" + Path.GetFileName(s);

       if (File.Exists("thumbsFilePath") {
                // checks for thumbnail of image
                html = "<img src= thumbsFilePath>";
       } elseif (imgHeight != currentImage.Height || imgWidth != currentImage.Width) {
                // image is larger than max height/width create thumbnail
                html = "<img src=createThumbnail.aspx?img=fullSizeImg>";
       } else {
                //image is smaller than thumbnail constraints so use full size image
                html = "<img src=fullSizeImg?";
       }

}

This will reducing the processing time to create the thumbnail images except for the first time an image is loaded.  The major drawback to doing this is that you are increasing your storage size.  Also if a full size image is deleted you are still storing a thumbnail image that will never be used/scene.

I guess it's one trade off for another.
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
ahh!  very nice.
Thank you!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

6 Experts available now in Live!

Get 1:1 Help Now