473,788 Members | 2,692 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 1843

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

Similar topics

51
5294
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
5992
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
1296
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
1207
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
9498
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
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6750
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
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
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
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.