How to set/remove the Exif Image Width/Height/Thumbnail attributes?

hack bear <[email protected]> Wed, 24 Jul 2013 15:39:07 -0700
Newsgroups gmane.comp.video.graphicsmagick.tools
Message-ID <[email protected]>
--===============6264868346556790828==
Content-Type: multipart/alternative;
	boundary="_7f958d7a-2c0e-4d70-b943-41e5a8939df8_"

--_7f958d7a-2c0e-4d70-b943-41e5a8939df8_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi=2C

I have patched GM to write out the updated attribute. It works for EXIF:Ori=
entation tag but cannot alter or remove the Exif Image Width/Height or Thum=
bnail tags. I tried several variants of the tag names like 'EXIF:Exif Image=
 Width'=2C 'Exif Image Width'=2C etc.=3B none works.

Why doesn't -set work for those attributes? And also how to remove an attri=
bute?

Thanks.

$ gm convert -auto-orient -set EXIF:Orientation 1 -set 'EXIF:ExifImageWidth=
' 320 -set EXIF:ThumbnailImage '' /tmp/photo_O5.jpg /tmp/o.jpg
$ exiftool -G -n /tmp/o.jpg
[ExifTool]      ExifTool Version Number         : 8.92
...
[File]          Image Width                     : 320 # updated correctly
[File]          Image Height                    : 369
...
[EXIF]          Orientation                     : 1    # this is updated co=
rrectly
...
[EXIF]          Exif Image Width                : 369 # is NOT updated
[EXIF]          Exif Image Height               : 320
[Composite]     Image Size                      : 320x369 # this is updated=
 correctly
[Composite]     Thumbnail Image                 : (Binary data 4223 bytes=
=2C use -b option to extract) # cannot be removed

From: [email protected]
To: [email protected]
Date: Wed=2C 22 May 2013 11:29:34 -0700
Subject: Re: [GM-tools] The orientation attribute and -orient command

=0A=
=0A=
=0A=
> it has to be done by the recipient user.  This would be based on an=20
> expectation that the recipient has smart softare which auto-rotates=20
> the image.

Unluckily some clients (flash?) do not handle the auto-rotate and so we hav=
e to do it on the server side. We also need to create scale down versions o=
f the images.

>=20
> Until GM edits EXIF tags=2C the issue is moot.
>=20
> Even when GM edits EXIF tags=2C GM will still not be the best way to=20
> rotate a JPEG image.  The 'jpegtran' utility would do a better job=20
> since it uses a lossless method to rotate the JPEG.

For now=2C I use exiftool to update the orientation attribute after GM rota=
tes. Will be grad to help out patching GM to update the EXIF attributes if =
I can squeeze some bandwidth.=20

Not familiar with jpegtran/libjpeg=2C will look at it to see if it fits in =
easily=3B sounds like it supports only JPEG=3B we may have to use GM still =
for other formats.

>=20
> Bob
> --=20
> Bob Friesenhahn
> [email protected]=2C http://www.simplesystems.org/users/bfries=
en/
> GraphicsMagick Maintainer=2C    http://www.GraphicsMagick.org/
>=20
> -------------------------------------------------------------------------=
-----
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring servi=
ce=20
> that delivers powerful full stack analytics. Optimize and monitor your
> browser=2C app=2C & 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_ma=
y
> _______________________________________________
> Graphicsmagick-tools mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools
 		 	   		  =0A=

---------------------------------------------------------------------------=
---=0A=
Try New Relic Now & We'll Send You this Cool Shirt=0A=
New Relic is the only SaaS-based application performance monitoring service=
 =0A=
that delivers powerful full stack analytics. Optimize and monitor your=0A=
browser=2C app=2C & servers with just a few lines of code. Try New Relic=0A=
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________=0A=
Graphicsmagick-tools mailing list=0A=
[email protected]=0A=
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools 		 	   		=
  =

--_7f958d7a-2c0e-4d70-b943-41e5a8939df8_
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 have patched GM t=
o write out the updated attribute. It works for EXIF:Orientation tag but ca=
nnot alter or remove the Exif Image Width/Height or Thumbnail tags. I tried=
 several variants of the tag names like 'EXIF:Exif Image Width'=2C 'Exif Im=
age Width'=2C etc.=3B none works.<br><br>Why doesn't -set work for those at=
tributes? And also how to remove an attribute?<br><br>Thanks.<br><br><font =
style=3D"" face=3D"Courier New">$ gm convert -auto-orient -set EXIF:Orienta=
tion 1 -set 'EXIF:ExifImageWidth' 320 -set EXIF:ThumbnailImage '' /tmp/phot=
o_O5.jpg /tmp/o.jpg</font><font style=3D"" face=3D"Courier New"><br></font>=
<font style=3D"" face=3D"Courier New">$ exiftool -G -n /tmp/o.jpg</font><fo=
nt style=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Cour=
ier New">[ExifTool]&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B ExifTool Versio=
n Number&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : =
8.92</font><font style=3D"" face=3D"Courier New"><br></font><font style=3D"=
" face=3D"Courier New">...</font><font style=3D"" face=3D"Courier New"><br>=
</font><font style=3D"" face=3D"Courier New">[File]&nbsp=3B&nbsp=3B&nbsp=3B=
&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B 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 : =
320 # updated correctly</font><font style=3D"" face=3D"Courier New"><br></f=
ont><font style=3D"" face=3D"Courier New">[File]&nbsp=3B&nbsp=3B&nbsp=3B&nb=
sp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B Image Height&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&nbsp=3B : 369</font><f=
ont style=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Cou=
rier New">...</font><font style=3D"" face=3D"Courier New"><br></font><font =
style=3D"" face=3D"Courier New">[EXIF]&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B Orientation&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&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B : 1</font><font=
 style=3D"" face=3D"Courier New">&nbsp=3B&nbsp=3B&nbsp=3B # this is updated=
 correctly</font><font style=3D"" face=3D"Courier New"><br></font><font sty=
le=3D"" face=3D"Courier New">...</font><font style=3D"" face=3D"Courier New=
"><br></font><font style=3D"" face=3D"Courier New">[EXIF]&nbsp=3B&nbsp=3B&n=
bsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B Exif Image Width&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&nbsp=3B&nbsp=3B : 369 # is NOT updated</font><f=
ont style=3D"" face=3D"Courier New"><br></font><font style=3D"" face=3D"Cou=
rier New">[EXIF]&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nb=
sp=3B&nbsp=3B Exif Image Height&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 : 320<=
/font><font style=3D"" face=3D"Courier New"><br></font><font style=3D"" fac=
e=3D"Courier New">[Composite]&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B Image Size&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=
&nbsp=3B&nbsp=3B : 320x369</font><font style=3D"" face=3D"Courier New"> # t=
his is updated correctly</font><font style=3D"" face=3D"Courier New"><br></=
font><font style=3D"" face=3D"Courier New">[Composite]&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B Thumbnail Image&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&nb=
sp=3B : (Binary data 4223 bytes=2C use -b option to extract)</font><font st=
yle=3D"" face=3D"Courier New"> # cannot be removed</font><font style=3D"" f=
ace=3D"Courier New"><br></font><font style=3D"" face=3D"Courier New"><br></=
font><div><hr id=3D"stopSpelling">From: [email protected]<br>To: grap=
[email protected]<br>Date: Wed=2C 22 May 2013 11:29:34=
 -0700<br>Subject: Re: [GM-tools] The orientation attribute and -orient com=
mand<br><br>=0A=
=0A=
<style><!--=0A=
.ExternalClass .ecxhmmessage P {=0A=
padding:0px=3B=0A=
}=0A=
=0A=
.ExternalClass body.ecxhmmessage {=0A=
font-size:12pt=3B=0A=
font-family:Calibri=3B=0A=
}=0A=
=0A=
--></style>=0A=
<div dir=3D"ltr">&gt=3B it has to be done by the recipient user.  This woul=
d be based on an <br><div>&gt=3B expectation that the recipient has smart s=
oftare which auto-rotates <br>&gt=3B the image.<br><br>Unluckily some clien=
ts (flash?) do not handle the auto-rotate and so we have to do it on the se=
rver side. We also need to create scale down versions of the images.<br><br=
>&gt=3B <br>&gt=3B Until GM edits EXIF tags=2C the issue is moot.<br>&gt=3B=
 <br>&gt=3B Even when GM edits EXIF tags=2C GM will still not be the best w=
ay to <br>&gt=3B rotate a JPEG image.  The 'jpegtran' utility would do a be=
tter job <br>&gt=3B since it uses a lossless method to rotate the JPEG.<br>=
<br>For now=2C I use exiftool to update the orientation attribute after GM =
rotates. Will be grad to help out patching GM to update the EXIF attributes=
 if I can squeeze some bandwidth. <br><br>Not familiar with jpegtran/libjpe=
g=2C will look at it to see if it fits in easily=3B sounds like it supports=
 only JPEG=3B we may have to use GM still for other formats.<br><br>&gt=3B =
<br>&gt=3B Bob<br>&gt=3B -- <br>&gt=3B Bob Friesenhahn<br>&gt=3B bfriesen@s=
imple.dallas.tx.us=2C http://www.simplesystems.org/users/bfriesen/<br>&gt=
=3B GraphicsMagick Maintainer=2C    http://www.GraphicsMagick.org/<br>&gt=
=3B <br>&gt=3B ------------------------------------------------------------=
------------------<br>&gt=3B Try New Relic Now &amp=3B We'll Send You this =
Cool Shirt<br>&gt=3B New Relic is the only SaaS-based application performan=
ce monitoring service <br>&gt=3B that delivers powerful full stack analytic=
s. Optimize and monitor your<br>&gt=3B browser=2C app=2C &amp=3B servers wi=
th just a few lines of code. Try New Relic<br>&gt=3B and get this awesome N=
erd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may<br>&gt=3B ____________=
___________________________________<br>&gt=3B Graphicsmagick-tools mailing =
list<br>&gt=3B [email protected]<br>&gt=3B https:/=
/lists.sourceforge.net/lists/listinfo/graphicsmagick-tools<br></div> 		 	  =
 		  </div>=0A=
<br>-----------------------------------------------------------------------=
-------=0A=
Try New Relic Now &amp=3B We'll Send You this Cool Shirt=0A=
New Relic is the only SaaS-based application performance monitoring service=
 =0A=
that delivers powerful full stack analytics. Optimize and monitor your=0A=
browser=2C app=2C &amp=3B servers with just a few lines of code. Try New Re=
lic=0A=
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may<=
br>_______________________________________________=0A=
Graphicsmagick-tools mailing list=0A=
[email protected]=0A=
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools</div> 		 =
	   		  </div></body>
</html>=

--_7f958d7a-2c0e-4d70-b943-41e5a8939df8_--


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

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
--===============6264868346556790828==
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

--===============6264868346556790828==--