필터 지우기
필터 지우기

how to write metadata information to a jpg file

조회 수: 40 (최근 30일)
Michael Phillips
Michael Phillips 2019년 2월 23일
댓글: Michael Phillips 2019년 2월 25일
Hello,
I'm reading in .JPG files taken with a Phantom 4pro drone. These files have the following meta data that I can grab with "imfinfo":
Filename: '/Volumes/Utumno/Chile_2016/SG-161018-51m_images_only/101MEDIA/DJI_0112.JPG'
FileModDate: '18-Oct-2016 10:33:46'
FileSize: 5672512
Format: 'jpg'
FormatVersion: ''
Width: 4000
Height: 3000
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
ImageDescription: 'DCIM\101MEDIA\DJI_0112.JPG'
Make: 'DJI'
Model: 'FC330'
Orientation: 1
XResolution: 72
YResolution: 72
ResolutionUnit: 'Inch'
Software: 'v01.19.5266'
DateTime: '2016:10:18 10:33:43'
YCbCrPositioning: 'Centered'
DigitalCamera: [1×1 struct]
GPSInfo: [1×1 struct]
UnknownTags: [3×1 struct]
ExifThumbnail: [1×1 struct]
I am manipulating these images and want to save them back out as a JPG with the same metadata that they strated with. However, when I save back out as a JPG the only metadata I can get to save are the following fields:
Filename: '/Volumes/Utumno/Chile_2016/SG-161018-51m_images_only/101MEDIA/rad_corr/test.JPG'
FileModDate: '23-Feb-2019 16:55:09'
FileSize: 2666899
Format: 'jpg'
FormatVersion: ''
Width: 4000
Height: 3000
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
which means I'm missing the latter 14 fields. How can I save this ancillary information with my newly manipulated JPGs?
thanks!

채택된 답변

Stephen23
Stephen23 2019년 2월 24일
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 2월 24일
tl;dr : Comment is the only metadata that Matlab itself supports writing.
Michael Phillips
Michael Phillips 2019년 2월 25일
Thanks Stephen! This is the link that really helped:
If you're running MATLAB on a Mac though you have to change
test = which('exiftool.exe');
to
test = '/usr/local/bin/exiftool'
or whatever path is appropriate for where you've downloaded the exiftool.
Thanks again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by