Go Premium for a chance to win a PS4. Enter to Win


Rotate jpg file based on EXIF data

Posted on 2008-10-27
Medium Priority
Last Modified: 2012-05-05
I am not sure there is a solution for what I want to do but I thought I would ask anyways...

I have a .net application that gets xml from an external source with images.
I am loading the xml and images and displaying them, no image attributes are contained in the XML file.
Some images are lanscape and some portrait

Is there a way somehow how to use the EXIF data in the JPG to work out whether the shot should be displayed horizontally or vertically and rotate the image as neccassary???
Question by:clearchannel
  • 4
  • 2

Author Comment

ID: 22865531
Those links don't really help with what I want to do. Sorry.
They relate to extractng the EXif data and lossless image support, neither refer to the image orientation etc.

Expert Comment

ID: 22865821
Both posts give details on how to get the PropertyItems from the EXIF data.
If I'm not mistaken the ProprtyItem you're interested in PropertyItem 274 - the Orientation tag.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 22865887
As you just linked to other EE posts, Can you point out where then as I did not see any reference.

Accepted Solution

openshac earned 1500 total points
ID: 22866093
I think all the articles talk about using the PropertyItems so you just need to be able to read those first.
Then I think you're interested in PropertyItem 274 - the Orientation tag.

Expert Comment

ID: 22866137
>>so you just need to be able to read those first

The PropertyItems collection that is (not the articles)

Didn't mean to sound condescending ;-)

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Integration Management Part 2
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

916 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