Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GetThumbNailImage and Pics with Thumbnails

Posted on 2003-11-19
7
Medium Priority
?
1,138 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
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!

 
LVL 1

Accepted Solution

by:
acorn73 earned 2000 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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