473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexpected Thumbnail Generation Behavior

I'm enabling users to rotate photos and generate thumbnails.

I have discovered that if, after a user rotates a photo 180 degrees, then
generates a thumbnail, that the resulting thumbnail appears unrotated (i.e.,
in original position, or rotated zero degrees).

Why is this? (and yes, I have verified that the "original" from which the
thumbnail is generated has, in fact, been rotated 180 degrees prior to
generating the thumbnail).

Here is the code that creates thumbnail:
System.IO.FileS tream fs = new System.IO.FileS tream(pathToFul lSizeImage,
System.IO.FileM ode.Open, System.IO.FileA ccess.Read);
System.Drawing. Image objThumbnail =
System.Drawing. Image.FromStrea m(fs).GetThumbn ailImage(iWidth , iHeight, null,
IntPtr.Zero);

Here is the code that rotates the original:
System.IO.FileS tream fs = new System.IO.FileS tream(pathToOri ginal,
System.IO.FileM ode.Open, System.IO.FileA ccess.ReadWrite );
System.Drawing. Image imageToFlip = System.Drawing. Image.FromStrea m(fs);
imageToFlip.Rot ateFlip(System. Drawing.RotateF lipType.Rotate9 0FlipNone);
// In order to rotate 180 degrees, the user clicks a button twice, which
executes above code twice.

Repeatedly clicking the button that executes the above code causes the
original to rotate in 90 degree increments: can go all the way around with
no problem, and thumbnails can be subsequently generated that reflect the
original's current rotation position - with the only exception being when
the original is rotated 180 degrees.

Any clues or explanations are greatly appreciated!
Nov 16 '05 #1
0 1844

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
5295
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
5
8252
by: Simon Wigzell | last post by:
I need a simple function to generate and save a thumbnail from a picture. It would require : Source Picture Fileame Thumbnail Height and Width Thumbnail Filename There are many pay programs available but they do far more than I require and I want the code to be built in to my code, not operate as a separate program. Any ideas? The browser knows how to resize pictures easily enough,
0
5614
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web documents. Thumbnail previews are useful for web site navigation particularly in search engines and directories such as Google, Altavista and Yahoo. The preview images provide a portion of the content of the electronic file to aid in navigation.
4
5994
by: | last post by:
Some time ago I installed VC# 2003, made a small generic project, compile with the allow unsafe flag and I get the error below: "error CS1577: Assembly generation failed -- Unexpected exception processing attribute -- System.ArgumentException: Invalid directory on URL." (If I do not compile with the unsafe flag compiler setting all compiles perfect) After long tracing, I ended up discovering that it is csc.exe installed by the .NET...
0
242
by: Cecil Windham | last post by:
I'm enabling users to rotate photos and generate thumbnails. I have discovered that if, after a user rotates a photo 180 degrees, then generates a thumbnail, that the resulting thumbnail appears unrotated (i.e., in original position, or rotated zero degrees). Why is this? (and yes, I have verified that the "original" from which the thumbnail is generated has, in fact, been rotated 180 degrees prior to generating the thumbnail).
1
1153
by: db | last post by:
In explorer you can change the view setting to thumbnails, and you get thumbnails even from movies. I want to do the same from asp.net. I want to create 'on the fly' thumbnails from some mpg movies, but I don't know if that's possible from asp.net. Who can help me with this?
1
1297
by: mo | last post by:
Hi, I have the following code to create a thumbnail from the input stream System.Drawing.Image source; source=System.Drawing.Image.FromStream(new System.IO.MemoryStream(myData)); System.Drawing.Image image = source.GetThumbnailImage 150,150,null,IntPtr.Zero); MemoryStream ms = new MemoryStream(); ImageFormat thisformat=image.RawFormat;
4
6569
by: dean.greg | last post by:
Im looking for a way to generate thumbnails from an image as fast as possible. Currently I'm using GDI+ however going from 1024x768 to 100x100 takes too long. I'd imagine the whole process can be optimized by using hardware acceleration (ie DirectX), however I am not all that familar with the DirectX API. What I'm looking for is some direction, or even some sample/psuedo code, that might point me in the right direction. If not...
2
1208
AaronL
by: AaronL | last post by:
Hello, I would like to have thumbnails generated automatically from images uploaded from my image upload system. Can anyone tell me what I need to do? Here is the link to my php info page, I'm not sure if gd is enabled or not. I may have to go with a freeware cgi script or something www.lambertsoftware.com/ecomm/phpinfo.php Thanks!
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.