Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, March 28, 2013 6:50:22 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

For some common image formats, the supported orientation (view perspective) values are either TOP_LEFT or BOTTOM_LEFT.
For example, Windows BMP files are usually stored as BOTTOM_LEFT (top-most line of pixels is stored LAST in the file) while PNG files are TOP_LEFT (top-most line of pixels is stored FIRST in the file).

However, some image file formats such as TIFF and EXIF support storing other orientation values, which means the image can be rotated in any direction.

Common sources of such files are cameras that contain gravity sensors which detect how the camera itself is rotated during taking the photo. Such cameras might always store the pixel data the same way regardless of how the camera is rotated, but they would indicate the camera, and thus the taken photo, are rotated by storing a metadata tag value to indicate orientation.

A sample rotated image is attached with this post. If you see the cannon displayed correctly upright, this means your viewer correctly reads the orientation tag and modifies the display accordingly.

If you see the cannon rotated to the left, this means your viewer is displaying the data as is, because the image data is actually rotated to the left. However, the orientation tag says the image has TOP_LEFT90 view perspective, which means the viewer should rotate it 90 degrees clockwise before displaying it.

What does this mean for your LEADTOOLS application?
- Option 1: Leave it to the default setting.
By default, LEADTOOLS will correctly load and display the images according to the stored orientation tag in the file. This means you simply load the image and don't worry about its view perspective.

- Option 2: Force the toolkit to disregard the Orientation tag.
Some applications require compatibility with older viewers that did not correctly interpret the view perspective values. If your application has this requirement, you can make it behave like these older viewers by setting the ELO_IGNOREVIEWPERSPECTIVE flag (C DLL and C++ ClassLib) or the RasterCodecs.Options.Tiff.Load.IgnoreViewPerspective (.NET) to true before loading the image.

- Option 3: Customize your own behavior.
If you want to neither respect the Orientation tag nor totally ignore it, you can do whatever type of rotation handling you like using our toolkit. First, get the file's view perspective value before loading it by using our FileInfo function to determine how you want it rotated. Then load the file and rotate it using the Rotate function. For more details read this forum thread:
https://www.leadtools.com/support/forum/posts/m2789-JPEG---width---height-reversed---Lead-14#post2789

File Attachment(s):
CannonTopLeft90.zip (75kb) downloaded 821 time(s).

Edited by moderator Tuesday, March 28, 2017 1:57:41 PM(UTC)  | Reason: Not specified

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.069 seconds.