Solved

GetThumbNailImage and Pics with Thumbnails

Posted on 2003-11-19
7
1,134 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery to restrict certain words from input in form 11 52
JQuery Autocomplete Tag AJAX (Need nice script) 11 73
Html split(text) Part2 6 41
SP result not being displayed 5 68
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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 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