The orientation attribute and -orient command

hack bear <[email protected]> Mon, 20 May 2013 09:58:03 -0700
Newsgroups gmane.comp.video.graphicsmagick.tools
Message-ID <[email protected]>
--===============3403482561614760540==
Content-Type: multipart/alternative;
	boundary="_d9cf0381-dcfb-449c-aa31-1cb27ddc76dd_"

--_d9cf0381-dcfb-449c-aa31-1cb27ddc76dd_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi=2C

I just want to use GM to rotate the image's orientation and update the EXIF=
 Orientation attribute. I can get the image rotated using -rotate. It seems=
 that there is no way to set or remove the orientation attribute. Hopefully=
 I can do it without involving another external process (I'm driving GM fro=
m the gm4java tool in batch mode.) What's the advice for doing that? When w=
ill GM start attaining some EXIF capability like ImageMagic?

Also I'm not sure exactly what the -orient command does. I tried it and it =
didn't seem to have an effect:

MAC: $ exiftool src/test/resources/photo_90.jpg | egrep 'Orient|Width|Heigh=
t'
Orientation                     : Rotate 90 CW
Exif Image Width                : 1600
Exif Image Height               : 1200
Image Width                     : 1600
Image Height                    : 1200
MAC175: $ gm convert -orient TopLeft src/test/resources/photo_90.jpg /tmp/g=
moriented.jpg
MAC175: $ exiftool /tmp/gmoriented.jpg | egrep 'Orient|Width|Height'
Orientation                     : Rotate 90 CW
Exif Image Width                : 1600
Exif Image Height               : 1200
Image Width                     : 1600 # no change
Image Height                    : 1200
# -rotate works as expected
MAC: $ gm convert -rotate 90 src/test/resources/photo_90.jpg /tmp/gmrotated=
.jpg
MAC: $ exiftool /tmp/gmrotated.jpg | egrep 'Orient|Width|Height'
Orientation                     : Rotate 90 CW
Exif Image Width                : 1600
Exif Image Height               : 1200
Image Width                     : 1200 # rotated!
Image Height                    : 1600

Since I only interested in orienting (i.e. rotate by multiple of 90 degrees=
) I would guess -orient may be faster than -rotate.

Thanks!


 		 	   		  =

--_d9cf0381-dcfb-449c-aa31-1cb27ddc76dd_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>Hi=2C<br><br>I just want to use =
GM to rotate the image's orientation and update the EXIF Orientation attrib=
ute. I can get the image rotated using -rotate. It seems that there is no w=
ay to set or remove the orientation attribute. Hopefully I can do it withou=
t involving another external process (I'm driving GM from the gm4java tool =
in batch mode.) What's the advice for doing that? When will GM start attain=
ing some EXIF capability like ImageMagic?<br><br>Also I'm not sure exactly =
what the -orient command does. I tried it and it didn't seem to have an eff=
ect:<br><br><font style=3D"" face=3D"Courier New">MAC: $ exiftool src/test/=
resources/photo_90.jpg | egrep 'Orient|Width|Height'</font><font style=3D""=
 face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New">Orie=
ntation&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B : Rotate 90 CW</font><font style=3D"" face=3D"Courier N=
ew"><br></font><font style=3D"" face=3D"Courier New">Exif Image Width&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B=
&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1600</font><font style=3D"" face=
=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New">Exif Imag=
e Height&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nb=
sp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><font style=3D""=
 face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New">Imag=
e Width&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B : 1600</font><font style=3D"" face=3D"Courier New"><br>=
</font><font style=3D"" face=3D"Courier New">Image Height&nbsp=3B&nbsp=3B&n=
bsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><f=
ont style=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Cou=
rier New">MAC175: $ gm convert -orient TopLeft src/test/resources/photo_90.=
jpg /tmp/gmoriented.jpg</font><font style=3D"" face=3D"Courier New"><br></f=
ont><font style=3D"" face=3D"Courier New">MAC175: $ exiftool /tmp/gmoriente=
d.jpg | egrep 'Orient|Width|Height'</font><font style=3D"" face=3D"Courier =
New"><br></font><font style=3D"" face=3D"Courier New">Orientation&nbsp=3B&n=
bsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B=
 : Rotate 90 CW</font><font style=3D"" face=3D"Courier New"><br></font><fon=
t style=3D"" face=3D"Courier New">Exif Image Width&nbsp=3B&nbsp=3B&nbsp=3B&=
nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B : 1600</font><font style=3D"" face=3D"Courier New"><br=
></font><font style=3D"" face=3D"Courier New">Exif Image Height&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><font style=3D"" face=3D"Courier N=
ew"><br></font><font style=3D"" face=3D"Courier New">Image Width&nbsp=3B&nb=
sp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B=
 : 1600</font><font style=3D"" face=3D"Courier New"> # no change<br></font>=
<font style=3D"" face=3D"Courier New">Image Height&nbsp=3B&nbsp=3B&nbsp=3B&=
nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><font sty=
le=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier Ne=
w"># -rotate works as expected</font><font style=3D"" face=3D"Courier New">=
<br></font><font style=3D"" face=3D"Courier New">MAC: $ gm convert -rotate =
90 src/test/resources/photo_90.jpg /tmp/gmrotated.jpg</font><font style=3D"=
" face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New">MAC=
: $ exiftool /tmp/gmrotated.jpg | egrep 'Orient|Width|Height'</font><font s=
tyle=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier =
New">Orientation&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nb=
sp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B : Rotate 90 CW</font><font style=3D"" face=3D"C=
ourier New"><br></font><font style=3D"" face=3D"Courier New">Exif Image Wid=
th&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&=
nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1600</font><font style=3D=
"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New">Ex=
if Image Height&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbs=
p=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><font sty=
le=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Courier Ne=
w">Image Width&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B=
&nbsp=3B&nbsp=3B&nbsp=3B : 1200</font><font style=3D"" face=3D"Courier New"=
> # rotated!</font><font style=3D"" face=3D"Courier New"><br></font><font s=
tyle=3D"" face=3D"Courier New">Image Height&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B=
&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nb=
sp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1600</font><font style=3D""=
 face=3D"Courier New"><br></font><br>Since I only interested in orienting (=
i.e. rotate by multiple of 90 degrees) I would guess -orient may be faster =
than -rotate.<br><br>Thanks!<br><br><br> 		 	   		  </div></body>
</html>=

--_d9cf0381-dcfb-449c-aa31-1cb27ddc76dd_--


--===============3403482561614760540==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
--===============3403482561614760540==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Graphicsmagick-tools mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools

--===============3403482561614760540==--