Solved

GetThumbNailImage and Pics with Thumbnails

Posted on 2003-11-19
7
1,132 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
ID: 9789018
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
ID: 9789690
right, i just need to figure out how to do this withought having thumbs that look like crap.
0
 

Expert Comment

by:thedrs
ID: 9816584
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
LVL 1

Accepted Solution

by:
acorn73 earned 500 total points
ID: 11113448
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
ID: 11117136
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
ID: 11144418
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
ID: 11144842
ahh!  very nice.
Thank you!
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dreamweaver server behavior gone 6 148
IP API - need data... 4 27
Index on a Table 6 25
MS SQL 2008 and stored prodcures and dates 5 13
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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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