{"action":"created","issue":{"url":"https://api.github.com/repos/Exiv2/exiv2/issues/392","repository_url":"https://api.github.com/repos/Exiv2/exiv2","labels_url":"https://api.github.com/repos/Exiv2/exiv2/issues/392/labels{/name}","comments_url":"https://api.github.com/repos/Exiv2/exiv2/issues/392/comments","events_url":"https://api.github.com/repos/Exiv2/exiv2/issues/392/events","html_url":"https://github.com/Exiv2/exiv2/issues/392","id":346523164,"node_id":"MDU6SXNzdWUzNDY1MjMxNjQ=","number":392,"title":"how to deep copy metadata from one image to another","user":{"login":"SmithPeng","id":37366612,"node_id":"MDQ6VXNlcjM3MzY2NjEy","avatar_url":"https://avatars2.githubusercontent.com/u/37366612?v=4","gravatar_id":"","url":"https://api.github.com/users/SmithPeng","html_url":"https://github.com/SmithPeng","followers_url":"https://api.github.com/users/SmithPeng/followers","following_url":"https://api.github.com/users/SmithPeng/following{/other_user}","gists_url":"https://api.github.com/users/SmithPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/SmithPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmithPeng/subscriptions","organizations_url":"https://api.github.com/users/SmithPeng/orgs","repos_url":"https://api.github.com/users/SmithPeng/repos","events_url":"https://api.github.com/users/SmithPeng/events{/privacy}","received_events_url":"https://api.github.com/users/SmithPeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-01T09:37:12Z","updated_at":"2018-08-01T19:14:10Z","closed_at":null,"author_association":"NONE","body":"I used 'exiv2 -pa in.tif' ,got following results:\r\n### \r\n`Exif.Image.ImageWidth                        Short       1  1280\r\nExif.Image.ImageLength                       Short       1  960\r\nExif.Image.BitsPerSample                     Short       1  16\r\nExif.Image.Compression                       Short       1  Uncompressed\r\nExif.Image.PhotometricInterpretation         Short       1  Black Is Zero\r\nExif.Image.ImageDescription                  Ascii       7  660 nm\r\nExif.Image.Make                              Ascii       7  Parrot\r\nExif.Image.Model                             Ascii       8  Sequoia\r\nExif.Image.StripOffsets                      Long        1  8\r\nExif.Image.Orientation                       Short       1  bottom, right\r\nExif.Image.SamplesPerPixel                   Short       1  1\r\nExif.Image.StripByteCounts                   Long        1  2457600\r\nExif.Image.PlanarConfiguration               Short       1  1\r\nExif.Image.Software                          Ascii       7  v1.4.1\r\nExif.Image.DateTime                          Ascii      20  2017:07:15 09:24:44\r\nExif.Image.XMLPacket                         Byte      4096  (Binary value suppressed)\r\nExif.Image.ExifTag                           Ifd         1  2457962\r\nExif.Photo.ExposureTime                      Rational    1  0.000761538 s\r\nExif.Photo.FNumber                           Rational    1  F2.2\r\nExif.Photo.SpectralSensitivity               Ascii       7  660 nm\r\nExif.Photo.ISOSpeedRatings                   Short       1  100\r\nExif.Photo.DateTimeOriginal                  Ascii      20  2017:07:15 09:24:44\r\nExif.Photo.DateTimeDigitized                 Ascii      20  1970:01:01 00:16:12\r\nExif.Photo.ShutterSpeedValue                 SRational   1  1/1313 s\r\nExif.Photo.ApertureValue                     Rational    1  F2.2\r\nExif.Photo.MaxApertureValue                  Rational    1  F2.2\r\nExif.Photo.FocalLength                       Rational    1  4.0 mm\r\nExif.Photo.SubSecTime                        Ascii       7  567898\r\nExif.Photo.SubSecTimeOriginal                Ascii       7  567898\r\nExif.Photo.SubSecTimeDigitized               Ascii       7  140503\r\nExif.Photo.PixelXDimension                   Long        1  1280\r\nExif.Photo.PixelYDimension                   Long        1  960\r\nExif.Photo.FocalPlaneXResolution             Rational    1  266.667\r\nExif.Photo.FocalPlaneYResolution             Rational    1  266.667\r\nExif.Photo.FocalPlaneResolutionUnit          Short       1  (4)\r\nExif.Photo.ExposureMode                      Short       1  Auto\r\nExif.Photo.FocalLengthIn35mmFilm             Short       1  30.0 mm\r\nExif.Photo.ImageUniqueID                     Ascii      33  3926CAAE2B8AA99F6EC80DFE6B9EA495\r\nExif.Photo.BodySerialNumber                  Ascii      19  PI040378AD7D003106\r\nExif.Image.GPSTag                            Ifd         1  2458434\r\nExif.GPSInfo.GPSVersionID                    Byte        4  2.2.0.0\r\nExif.GPSInfo.GPSLatitudeRef                  Ascii       2  North\r\nExif.GPSInfo.GPSLatitude                     Rational    3  44deg 23' 36.574\"\r\nExif.GPSInfo.GPSLongitudeRef                 Ascii       2  East\r\nExif.GPSInfo.GPSLongitude                    Rational    3  85deg 54' 53.616\"\r\nExif.GPSInfo.GPSAltitudeRef                  Byte        1  Above sea level\r\nExif.GPSInfo.GPSAltitude                     Rational    1  532.7 m\r\nExif.GPSInfo.GPSTimeStamp                    Rational    3  09:24:42.8\r\nExif.GPSInfo.GPSStatus                       Ascii       2  Measurement in progress\r\nExif.GPSInfo.GPSSpeedRef                     Ascii       2  km/h\r\nExif.GPSInfo.GPSSpeed                        Rational    1  2147483647/32703466\r\nExif.GPSInfo.GPSMapDatum                     Ascii       7  WGS-84\r\nExif.GPSInfo.GPSDateStamp                    Ascii      11  2017:07:15\r\nExif.Image.BlackLevelRepeatDim               Short       2  2 2\r\nExif.Image.BlackLevel                        Long        4  7445 7523 7481 7483\r\nExif.Image.CameraSerialNumber                Ascii      19  PI040378AD7D003106\r\nExif.Image.OriginalRawFileName               Byte       31  73 77 71 95 49 55 48 55 49 53 95 48 57 50 52 52 52 95 48 52 48 54 95 82 69 68 46 84 73 70 0\r\nXmp.Camera.RigName                           XmpText     7  Sequoia\r\nXmp.Camera.RigCameraIndex                    XmpText     1  1\r\nXmp.Camera.Yaw                               XmpText    10  -20.153639\r\nXmp.Camera.Pitch                             XmpText     9  -2.306569\r\nXmp.Camera.Roll                              XmpText     8  7.731934\r\nXmp.Camera.BandGain                          XmpText     8  1.000000\r\nXmp.Camera.SensorTemperature                 XmpText     9  73.571411\r\nXmp.Camera.LineReadoutTime                   XmpText     5  23076\r\nXmp.Camera.RigRelatives                      XmpText    58  -0.204075992967256,-0.131260584800942,-0.00715957119893822\r\nXmp.Camera.PrincipalPoint                    XmpText    17  2.556034,1.768705\r\nXmp.Camera.ModelType                         XmpText     7  fisheye\r\nXmp.Camera.FisheyeAffineSymmetric            XmpText     1  1\r\nXmp.Camera.FisheyeAffineMatrix               XmpText    33  1657.439789335,0,0,1657.439789335\r\nXmp.Camera.FisheyePolynomial                 XmpText    28  0,1,0.016237875,-0.156401792\r\nXmp.Camera.GPSXYAccuracy                     XmpText     8  0.596798\r\nXmp.Camera.GPSZAccuracy                      XmpText     8  0.914000\r\nXmp.Camera.FlightUUID                        XmpText    32  DD4B2E9EAC666AD9F4565ACD0D56F0CE\r\nXmp.Camera.CaptureUUID                       XmpText    32  D374699AEA53001990F3CF980EB16AE3\r\nXmp.Camera.SunshineSerialNumber              XmpText    18  PI040379BB7D003235\r\nXmp.Camera.IrradianceCalibrationMeasurement  XmpText    59  0,600,34,9,1,600,826,222,2,600,13821,3630,3,600,65535,65535\r\nXmp.Camera.CalibrationMeasurement            XmpText    25  1,0.00258397932816537,472\r\nXmp.Camera.CalibrationPicture                XmpText     1  0\r\nXmp.Camera.IrradianceCalibrationMeasurementGolden XmpText    63  0,600,33,8 ,1,600,818,210 ,2,600,13685,3462 ,3,600,65535,65535\r\nXmp.Camera.IrradianceSensitivitiesGolden     XmpText    20  367.84662,97.5327952\r\nXmp.Camera.IrradianceUnitScale               XmpText    18  1.7873713395012918\r\nXmp.Camera.SensorModel                       XmpSeq      1  284151.2689060456,4771.694691528466,2797.1620265741567\r\n\r\nXmp.Camera.BandName                          XmpSeq      1  Red\r\nXmp.Camera.CentralWavelength                 XmpSeq      1  660.000000\r\nXmp.Camera.WavelengthFWHM                    XmpSeq      1  40.000000\r\nXmp.Camera.BlackCurrent                      XmpSeq      1  76.000000\r\nXmp.Camera.VignettingPolynomial2DName        XmpSeq      1  0,0,1,0,2,0,3,0,4,0,0,1,0,2,0,3,0,4,1,1,1,2,1,3,2,1,2,2,3,1\r\nXmp.Camera.VignettingPolynomial2D            XmpSeq      1  0.7089477528133445,1.1704369645811359,-2.1554127203967468,1.9882022411451421,-0.8729387111138820,0.3923627372846291,-0.4593519006320445,0.1123857772576540,-0.0805605979731263,-0.9200345519459264,0.8342438121532845,0.0305598321600225,0.9638772215100829,-0.8419755426105473,-0.0780893133094093\r\nXmp.Camera.InvalidPixel                      XmpSeq      1  1148,118,1148,118,249,618,182,709\r\nXmp.Camera.IrradianceList                    XmpText   338\r\n6a/YOQAAAABMD/UDAQBkABBjM0JnZhVBgxBJwKeu2zkAAAAAHg/pAwEAZADqgjVCGOkQQdNlvL9Xv945AAAAAA0P5QMBAGQAYm81QtDkC0FT4g/Akc7hOQAAAAAPD+UDAQBkAKO0NUK7gxBBYsYhwKvn5DkAAAAAGA/nAwEAZACyRDVCS8UcQVfjKsDP6+c5AAAAAMcO0gMBAGQAE1c2QoXwGkF2Epu/lvnqOQAAAADeDtgDAQBkAJF6OEJuIC9Bp4MLvRsH7jkAAAAA/w7hAwEAZAArajdCkA8mQZSeLsDdDvE5AAAAAA0P5QMBAGQAFX84QpmuL0HGvxTA`\r\n\r\n\r\n\r\n\r\n\r\nand used 'exiv2 -ex a in.tif', I got in.exv, as following:\r\n\r\nExif.Image.ImageWidth                        Short       1  1280\r\nExif.Image.ImageLength                       Short       1  960\r\nExif.Image.BitsPerSample                     Short       3  8 8 8\r\nExif.Image.Compression                       Short       1  Uncompressed\r\nExif.Image.PhotometricInterpretation         Short       1  RGB\r\nExif.Image.SamplesPerPixel                   Short       1  3\r\nExif.Image.RowsPerStrip                      Short       1  2\r\n▽\r\nÿ^AExiv2ÿá^T^Bhttp://ns.adobe.com/xap/1.0/^@<?xpacket begin=\"ï»¿\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> <x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 4.4.0-Exiv2\"> <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"> <rdf:Description rdf:about=\"\" xmlns:Camera=\"http://pix4d.com/camera/1.0/\" Camera:RigName=\"Sequoia\" Camera:RigCameraIndex=\"1\" Camera:Yaw=\"-20.153639\" Camera:Pitch=\"-2.306569\" Camera:Roll=\"7.731934\" Camera:BandGain=\"1.000000\" Camera:SensorTemperature=\"73.571411\" Camera:LineReadoutTime=\"23076\" Camera:RigRelatives=\"-0.204075992967256,-0.131260584800942,-0.00715957119893822\" Camera:PrincipalPoint=\"2.556034,1.768705\" Camera:ModelType=\"fisheye\" Camera:FisheyeAffineSymmetric=\"1\" Camera:FisheyeAffineMatrix=\"1657.439789335,0,0,1657.439789335\" Camera:FisheyePolynomial=\"0,1,0.016237875,-0.156401792\" Camera:GPSXYAccuracy=\"0.596798\" Camera:GPSZAccuracy=\"0.914000\" Camera:FlightUUID=\"DD4B2E9EAC666AD9F4565ACD0D56F0CE\" Camera:CaptureUUID=\"D374699AEA53001990F3CF980EB16AE3\" Camera:SunshineSerialNumber=\"PI040379BB7D003235\" Camera:IrradianceCalibrationMeasurement=\"0,600,34,9,1,600,826,222,2,600,13821,3630,3,600,65535,65535\" Camera:CalibrationMeasurement=\"1,0.00258397932816537,472\" Camera:CalibrationPicture=\"0\" Camera:IrradianceCalibrationMeasurementGolden=\"0,600,33,8 ,1,600,818,210 ,2,600,13685,3462 ,3,600,65535,65535 \" Camera:IrradianceSensitivitiesGolden=\"367.84662,97.5327952\" Camera:IrradianceUnitScale=\"1.7873713395012918\" Camera:IrradianceList=\"&#xA;6a/YOQAAAABMD/UDAQBkABBjM0JnZhVBgxBJwKeu2zkAAAAAHg/pAwEAZADqgjVCGOkQQdNlvL9Xv945AAAAAA0P5QMBAGQAYm81QtDkC0FT4g/Akc7hOQAAAAAPD+UDAQBkAKO0NUK7gxBBYsYhwKvn5DkAAAAAGA/nAwEAZACyRDVCS8UcQVfjKsDP6+c5AAAAAMcO0gMBAGQAE1c2QoXwGkF2Epu/lvnqOQAAAADeDtgDAQBkAJF6OEJuIC9Bp4MLvRsH7jkAAAAA/w7hAwEAZAArajdCkA8mQZSe\r\n\"IMG_170715_092444_0406.exv\" [noeol][converted] 1L, 5141C              1,1           All\r\n\r\nhow can I GOT the results showing in 'exiv2 -pa in.tif' and insert to out.jpg?"},"comment":{"url":"https://api.github.com/repos/Exiv2/exiv2/issues/comments/409689778","html_url":"https://github.com/Exiv2/exiv2/issues/392#issuecomment-409689778","issue_url":"https://api.github.com/repos/Exiv2/exiv2/issues/392","id":409689778,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTY4OTc3OA==","user":{"login":"clanmills","id":529982,"node_id":"MDQ6VXNlcjUyOTk4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/529982?v=4","gravatar_id":"","url":"https://api.github.com/users/clanmills","html_url":"https://github.com/clanmills","followers_url":"https://api.github.com/users/clanmills/followers","following_url":"https://api.github.com/users/clanmills/following{/other_user}","gists_url":"https://api.github.com/users/clanmills/gists{/gist_id}","starred_url":"https://api.github.com/users/clanmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clanmills/subscriptions","organizations_url":"https://api.github.com/users/clanmills/orgs","repos_url":"https://api.github.com/users/clanmills/repos","events_url":"https://api.github.com/users/clanmills/events{/privacy}","received_events_url":"https://api.github.com/users/clanmills/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T19:14:10Z","updated_at":"2018-08-01T19:14:10Z","author_association":"COLLABORATOR","body":"There are several ways to pipe metadata from one image to another.  I'll illustrate two methods with the following files:\r\n`http://clanmills.com/Stonehenge.jpg` with contains GPS metadata\r\n`http://clanmills.com/Flag.jpg` which does not contain GPS metadata\r\n\r\n**Method 1**\r\nPipe the metadata directly using the option -ee- to extract the metadata to std-output and -ie- to read the metadata from std-input.  The data on the pipe can be filtered with the --grep option.  This method uses the binary .exv file format to pass the data on the pipe.\r\n\r\n```\r\n627 rmills@rmillsmbp:~/temp $ curl --silent -O http://clanmills.com/Stonehenge.jpg -O http://clanmills/Flag.jpg\r\n628 rmills@rmillsmbp:~/temp $ ls -alt *.jpg  # sniff the files\r\n-rw-r--r--  1 rmills  staff  1695787  1 Aug 19:57 Flag.jpg\r\n-rw-r--r--  1 rmills  staff  6757827  1 Aug 19:57 Stonehenge.jpg\r\n629 rmills@rmillsmbp:~/temp $ exiv2 -pa --grep GPS Flag.jpg  # no GPS metadata \r\n630 rmills@rmillsmbp:~/temp $ exiv2 -pa --grep GPS Stonehenge.jpg  # has GPS metadata\r\nExif.Image.GPSTag                            Long        1  4060\r\nExif.GPSInfo.GPSVersionID                    Byte        4  2.3.0.0\r\nExif.GPSInfo.GPSLatitudeRef                  Ascii       2  North\r\nExif.GPSInfo.GPSLatitude                     Rational    3  51deg 10.69690' \r\nExif.GPSInfo.GPSLongitudeRef                 Ascii       2  West\r\nExif.GPSInfo.GPSLongitude                    Rational    3  1deg 49.59840' \r\nExif.GPSInfo.GPSAltitudeRef                  Byte        1  Above sea level\r\nExif.GPSInfo.GPSAltitude                     Rational    1  97 m\r\nExif.GPSInfo.GPSTimeStamp                    Rational    3  14:38:55.9\r\nExif.GPSInfo.GPSSatellites                   Ascii       3  09\r\nExif.GPSInfo.GPSMapDatum                     Ascii      17  WGS-84          \r\nExif.GPSInfo.GPSDateStamp                    Ascii      11  2015:07:16\r\n631 rmills@rmillsmbp:~/temp $ exiv2 -ee- --grep GPS Stonehenge.jpg | exiv2 -ie- Flag.jpg # pipe the data \r\n632 rmills@rmillsmbp:~/temp $ exiv2 -pa  --grep GPS Flag.jpg  # Flag now has GPS metadata\r\nExif.Image.GPSTag                            Long        1  4170\r\nExif.GPSInfo.GPSVersionID                    Byte        4  2.3.0.0\r\nExif.GPSInfo.GPSLatitudeRef                  Ascii       2  North\r\nExif.GPSInfo.GPSLatitude                     Rational    3  51deg 10.69690' \r\nExif.GPSInfo.GPSLongitudeRef                 Ascii       2  West\r\nExif.GPSInfo.GPSLongitude                    Rational    3  1deg 49.59840' \r\nExif.GPSInfo.GPSAltitudeRef                  Byte        1  Above sea level\r\nExif.GPSInfo.GPSAltitude                     Rational    1  97 m\r\nExif.GPSInfo.GPSTimeStamp                    Rational    3  14:38:55.9\r\nExif.GPSInfo.GPSSatellites                   Ascii       3  09\r\nExif.GPSInfo.GPSMapDatum                     Ascii      17  WGS-84          \r\nExif.GPSInfo.GPSDateStamp                    Ascii      11  2015:07:16\r\n634 rmills@rmillsmbp:~/temp $  \r\n```\r\n\r\n**Method 2**\r\nUse the option -PV to print **`set `** in front of the metadata to std-output.  The option -m- will read a 'command-file' from std-input.  The data on the pipe is ascii and can be manipulated by sed and other unix pipe tools.\r\n\r\n```\r\n643 rmills@rmillsmbp:~/temp $ curl --silent -O http://clanmills.com/Stonehenge.jpg -O http://clanmills/Flag.jpg\r\n644 rmills@rmillsmbp:~/temp $ ls -alt *.jpg\r\n-rw-r--r--  1 rmills  staff  1695787  1 Aug 20:10 Flag.jpg\r\n-rw-r--r--  1 rmills  staff  6757827  1 Aug 20:10 Stonehenge.jpg\r\n645 rmills@rmillsmbp:~/temp $ exiv2 -PVk --grep GPS Stonehenge.jpg # print 'set ' metadata\r\nset Exif.Image.GPSTag                             4060\r\nset Exif.GPSInfo.GPSVersionID                     2 3 0 0\r\nset Exif.GPSInfo.GPSLatitudeRef                   N\r\nset Exif.GPSInfo.GPSLatitude                      51/1 106969/10000 0/1\r\nset Exif.GPSInfo.GPSLongitudeRef                  W\r\nset Exif.GPSInfo.GPSLongitude                     1/1 495984/10000 0/1\r\nset Exif.GPSInfo.GPSAltitudeRef                   0\r\nset Exif.GPSInfo.GPSAltitude                      97/1\r\nset Exif.GPSInfo.GPSTimeStamp                     14/1 38/1 5588/100\r\nset Exif.GPSInfo.GPSSatellites                    09\r\nset Exif.GPSInfo.GPSMapDatum                      WGS-84          \r\nset Exif.GPSInfo.GPSDateStamp                     2015:07:16\r\n646 rmills@rmillsmbp:~/temp $ exiv2 -PVk --grep GPS Stonehenge.jpg | exiv2 -m- Flag.jpg ; exiv2 -pa --grep GPS Flag.jpg # pipe the 'set' commands into Flag.jpg and print the GPS data\r\nExif.Image.GPSTag                            Long        1  684\r\nExif.GPSInfo.GPSVersionID                    Byte        4  2.3.0.0\r\nExif.GPSInfo.GPSLatitudeRef                  Ascii       2  North\r\nExif.GPSInfo.GPSLatitude                     Rational    3  51deg 10.69690' \r\nExif.GPSInfo.GPSLongitudeRef                 Ascii       2  West\r\nExif.GPSInfo.GPSLongitude                    Rational    3  1deg 49.59840' \r\nExif.GPSInfo.GPSAltitudeRef                  Byte        1  Above sea level\r\nExif.GPSInfo.GPSAltitude                     Rational    1  97 m\r\nExif.GPSInfo.GPSTimeStamp                    Rational    3  14:38:55.9\r\nExif.GPSInfo.GPSSatellites                   Ascii       3  09\r\nExif.GPSInfo.GPSMapDatum                     Ascii       7  WGS-84\r\nExif.GPSInfo.GPSDateStamp                    Ascii      11  2015:07:16\r\n647 rmills@rmillsmbp:~/temp $ \r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"clanmills"}}