This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Computer Graphics with Photoshop > March 2007 > How to detect orentation of an image inan action





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to detect orentation of an image inan action
me@me.com

2007-02-27, 3:15 am

I want to write an action that works on and can detect if the image is
landscape or portrait.

The Break down is

If portrait then set the image height to 400px
If portrait then set the image width to 400px

Set the canvas size = 410 X 410

Then there is other processing to be done…
The rest I can do no Problems
Andrew Morton

2007-02-27, 6:14 am

me@me.com wrote:
> I want to write an action that works on and can detect if the image is
> landscape or portrait.
>
> The Break down is
>
> If portrait then set the image height to 400px
> If portrait then set the image width to 400px


Assuming you meant "If landscape" for the last one...
File->Automate->Fit Image... and set each dimension to 400px.

> Set the canvas size = 410 X 410


Image->Canvas Size... - you may need to set the canvas extension background
colour.

Andrew


jls

2007-02-27, 6:14 pm

On Tue, 27 Feb 2007 08:54:06 -0000, "Andrew Morton"
<akm@in-press.co.uk.invalid> wrote:

>me@me.com wrote:
>
>Assuming you meant "If landscape" for the last one...
>File->Automate->Fit Image... and set each dimension to 400px.
>
>
>Image->Canvas Size... - you may need to set the canvas extension background
>colour.
>
>Andrew
>


Hmm... for me, I just avoid rotating "portrait"-oriented pictures.
That way, all my pictures are always oriented in the same direction in
Photoshop and all my actions just work.

If I'm printing, it never matters anyway. If I want it for web
viewing, I can always rotate the portrait-oriented ones myself as a
final step (e.g., put all of them in a separate folder and have an
action that rotates all of the images in that folder and outputs to a
new folder).
MetaMorph

2007-02-27, 6:14 pm

If you are talking about Dig. camera images... I have been thinking about this
too - what is REALLY required is for the camera software to write a bit to the
EXIF information for each file. This bit ought to be 0 if the camera is held in
landscape mode and 1 if in portrait mode, for example.

To ascertain which is which - I would suggest a simple tilt device in the
camera body which could detect the rotation angle - in fact a more complex
piece of kit could tell exactly what angle the camera is being held at and then
that information oughtt to go in the Files EXIF info..

The Application software would of course then have to read this data from the
EXIF information to determine whether the image was portrait or landscape.

This would save an awful lot of tilting ones head when viewing images on a TV
screen, for instance, where image rotation may not be available...
Would help in other ways too of course..

Just a thought!!
Rudy Benner

2007-02-27, 10:14 pm


"MetaMorph" <aftmid@tpg.com.au> wrote in message
news:R52Fh.35081$s72.9898@fe12.news.easynews.com...
> If you are talking about Dig. camera images... I have been thinking about
> this too - what is REALLY required is for the camera software to write a
> bit to the EXIF information for each file. This bit ought to be 0 if the
> camera is held in landscape mode and 1 if in portrait mode, for example.
>
> To ascertain which is which - I would suggest a simple tilt device in
> the camera body which could detect the rotation angle - in fact a more
> complex piece of kit could tell exactly what angle the camera is being
> held at and then that information oughtt to go in the Files EXIF info..
>
> The Application software would of course then have to read this data
> from the EXIF information to determine whether the image was portrait or
> landscape.
>
> This would save an awful lot of tilting ones head when viewing images on
> a TV screen, for instance, where image rotation may not be available...
> Would help in other ways too of course..
>
> Just a thought!!


This is nothing new, many cameras already utilize this. Many software suites
also use this.


Johan W. Elzenga

2007-02-28, 6:14 am

MetaMorph <aftmid@tpg.com.au> wrote:

> If you are talking about Dig. camera images... I have been thinking about
> this too - what is REALLY required is for the camera software to write a
> bit to the EXIF information for each file. This bit ought to be 0 if the
> camera is held in landscape mode and 1 if in portrait mode, for example.
>
> To ascertain which is which - I would suggest a simple tilt device in
> the camera body which could detect the rotation angle - in fact a more
> complex piece of kit could tell exactly what angle the camera is being
> held at and then that information oughtt to go in the Files EXIF info..
>
> The Application software would of course then have to read this data
> from the EXIF information to determine whether the image was portrait or
> landscape.
>
> This would save an awful lot of tilting ones head when viewing images
> on a TV screen, for instance, where image rotation may not be available...
> Would help in other ways too of course..
>
> Just a thought!!


Almost every modern digital camera has this option already, and in fact,
that is exactly why the OP has his problem. Because the images are
rotated already, he needs to use 'Fit Image' to resize them because
there are portrait and landscape images.


--
Johan W. Elzenga johan<<at>>johanfoto.nl
Editor / Photographer http://www.johanfoto.com
MetaMorph

2007-02-28, 6:14 pm

Are you saying some digital cameras' embedded software writes a status word to
the files exif information so that application software can tell whether its a
portrait or landscape image? If so - which cameras and what is the status word/bit?
GordonG

2007-02-28, 10:14 pm

MetaMorph wrote:
> Are you saying some digital cameras' embedded software writes a status
> word to the files exif information so that application software can tell
> whether its a portrait or landscape image? If so - which cameras and
> what is the status word/bit?


My Canon digitals have always had this ability. They use a sensor in the
camera to detect which way is up (I understand it's a small metal ball
in a curved tube)and my downloading software - Breeze Systems Downloader
Pro - can orient the picture correctly. Don't ask me which EXIF bit it
is, though. I'm a photographer, not a programmer :)
Johan W. Elzenga

2007-03-01, 6:14 pm

MetaMorph <aftmid@tpg.com.au> wrote:

> Are you saying some digital cameras' embedded software writes a status
> word to the files exif information so that application software can tell
> whether its a portrait or landscape image? If so - which cameras and what
> is the status word/bit?


Yep, that's what I'm saying. Not 'some' cameras, almost every modern
camera has this ability. Perhaps the very cheap ones don't, but the rest
do. It's not a word, it's two bits in the EXIF data. The first bit tells
if an image should be rotated or not. The second bit tells in which
direction (+90° or -90°).


--
Johan W. Elzenga johan<<at>>johanfoto.nl
Editor / Photographer http://www.johanfoto.com
MetaMorph

2007-03-04, 10:14 pm

Johan and GordonG
Thanks for that information - I have fuji Digital cameras - 6500 and S7000
(and an ld 4900) - I will take a look - though I don't appear ever have been
given the option when opening a file is PS (or PSP), of rotating an image..
Maybe PS does not have this functionality (I have PS7)

cheers
Rudy Benner

2007-03-04, 10:14 pm


"MetaMorph" <aftmid@tpg.com.au> wrote in message
news:45EB40C1.5060207@tpg.com.au...
> Johan and GordonG
> Thanks for that information - I have fuji Digital cameras - 6500 and
> S7000 (and an ld 4900) - I will take a look - though I don't appear ever
> have been given the option when opening a file is PS (or PSP), of rotating
> an image.. Maybe PS does not have this functionality (I have PS7)
>
> cheers


send me a file --- rudy at rudybenner dot com

I will email you back


MetaMorph

2007-03-04, 10:14 pm

Rudy
Hi - thanks for the offer - but I looked in the EXIF information for 3 images
from the 3 different cameras - there is nothing in there I can see

Cheers
Rudy Benner

2007-03-04, 10:14 pm


"MetaMorph" <aftmid@tpg.com.au> wrote in message
news:TxIGh.113881$gl2.89412@fe10.news.easynews.com...
> Rudy
> Hi - thanks for the offer - but I looked in the EXIF information for 3
> images from the 3 different cameras - there is nothing in there I can see
>
> Cheers


http://www.takenet.or.jp/~ryuuji/mi...ifread/english/

I just checked 4 cameras, all have the orientation sensor and this shows on
the exif data. Whether or not software uses it is another matter.

r.


Mike

2007-03-04, 10:14 pm

In article <1hub4qm.d8j7k0vw4ve0N%nomail@please.invalid>, nomail@please.inv=
alid says...
> MetaMorph <aftmid@tpg.com.au> wrote:
>=20
l[color=darkred]
at[color=darkred]
>=20
> Yep, that's what I'm saying. Not 'some' cameras, almost every modern
> camera has this ability. Perhaps the very cheap ones don't, but the rest
> do. It's not a word, it's two bits in the EXIF data. The first bit tells
> if an image should be rotated or not. The second bit tells in which
> direction (+90=B0 or -90=B0).
>=20

Seems a little wasteful to me. With 2 bits of info they could have 0,+/-90,=
_and_ 180 degrees (just in case you were=20
holding the camera upside-down).

Mike
Johan W. Elzenga

2007-03-05, 6:14 pm

Mike <m.fee@iirrll..ccrrii..nnzz> wrote:

> Seems a little wasteful to me. With 2 bits of info they could have
> 0,+/-90, _and_ 180 degrees (just in case you were holding the camera
> upside-down).


Except that I don't think that the orientation sensor records that...


--
Johan W. Elzenga johan<<at>>johanfoto.nl
Editor / Photographer http://www.johanfoto.com
MetaMorph

2007-03-05, 6:14 pm

Hi again
Ok - thanks for that link - will take a look.

Another poster suggested this isn't what the orientation sensor records, if
not, what IS it?
Beautiful

2007-03-13, 5:17 am

Britney Spears Spreading Outdoors!
http://Britney-Spears-Spreading-Out...hp?movie=239202
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews