473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.FileStream fs = new System.IO.FileStream(pathToFullSizeImage,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.Drawing.Image objThumbnail =
System.Drawing.Image.FromStream(fs).GetThumbnailIm age(iWidth, iHeight, null,
IntPtr.Zero);

Here is the code that rotates the original:
System.IO.FileStream fs = new System.IO.FileStream(pathToOriginal,
System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
System.Drawing.Image imageToFlip = System.Drawing.Image.FromStream(fs);
imageToFlip.RotateFlip(System.Drawing.RotateFlipTy pe.Rotate90FlipNone);
// 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 1796

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

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
5
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...
0
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...
4
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...
0
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...
1
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...
1
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));...
4
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.