Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 19, 2018 2:58 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: jpg photo orientation
PostPosted: Wed Oct 24, 2012 10:50 am 
Offline

Joined: Sat Feb 14, 2009 3:30 am
Posts: 13
Please forgive me if this isn't the proper place for this question.

Is there an easy way to programmatically determine the orientation of a jpg from a digital camera?


Top
 Profile  
Reply with quote  
 Post subject: Re: jpg photo orientation
PostPosted: Wed Oct 24, 2012 9:43 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
This is a good place to ask this question.

What you need to do is to read the image meta data, there are classes and maybe some code snippets do this. I used to sell an object for reading ( and writing ) the image meta data for images.

If you like to do things yourself, you can dig up the specifications for JPEG and TIFF (as JPEG meta data is TIFF meta data) and write your own code to do this. If you're developing a Mac only application, then take a look at writing code to access Apple's Core Graphics, as Apple have a pretty solid meta data system built-in.

Lastly, if you're developing a Mac only application, and don't want to write your own code, you could use something like the MBS plugin to access Apple's Core Graphics and read the meta data from a JPEG.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: jpg photo orientation
PostPosted: Thu Oct 25, 2012 8:38 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
CGImageSourceMBS can read it on Mac. I think GMImageMBS does it cross platform.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: jpg photo orientation
PostPosted: Thu Oct 25, 2012 12:28 pm 
Offline

Joined: Fri Dec 01, 2006 3:09 pm
Posts: 650
Location: Tennessee, USA
I have a little program I wrote some time back that will get the size in bytes along with the width and height of BMP, GIF, JPG, PICT,, PNG, and TIF files. I am more than willing to send you a copy of it and from it you can look at the processFIle method which determines the type of graphic file along with the analyseJPG method which gets the width and height values from within the file. JPG is one of those formats that does not contain the height and width values in a fixed position within the file but knowing the JPG layout the fields can be found and extracted.

E-mail me at harriew at frontiernet dot net and I will send you a copy of the program if you wish to do it yourself without the plugins.


Top
 Profile  
Reply with quote  
 Post subject: Re: jpg photo orientation
PostPosted: Tue Oct 30, 2012 3:30 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
If the camera supports EXIF, then the header may contain the orientation flag.
You'll need to read up on the EXIF standard, then parse the header to read the flag.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group