Solved

GetThumbNailImage and Pics with Thumbnails

Posted on 2003-11-19
7
1,133 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
[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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordpress display sub menu only when click 12 75
Help with query 3 36
MS SQL and column defined as time 7 25
Extracting nodes  using classical ASP 3 25
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 informatio…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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