Skip to content

Instantly share code, notes, and snippets.

@aanoaa
Created June 14, 2013 05:50
Show Gist options
  • Save aanoaa/5779743 to your computer and use it in GitHub Desktop.
Save aanoaa/5779743 to your computer and use it in GitHub Desktop.
$ cpanm Image::ExifTool

제 경우에는 문제없이 설치 되었습니다.

#!/usr/bin/env perl
use strict;
use warnings;
use Image::ExifTool;

my $exifTool = new Image::ExifTool;
$exifTool->ExtractInfo('a.jpg');
print "Software: ", $exifTool->GetValue('Software'), "\n";

$exifTool->SetNewValue( 'Software', 'Image::ExitTool' );
if ( $exifTool->WriteInfo( 'a.jpg', 'b.jpg' ) ) {
    print "success for WriteInfo\n";
    $exifTool->ExtractInfo('b.jpg');
    print "Software: ", $exifTool->GetValue('Software'), "\n";
}
~/Desktop $ ls -l *.jpg
-rw-r--r--   1 hshong         hshong      87482  7월 23  2008 a.jpg
-rw-r--r--   1 hshong         hshong      87468  6월 14 14:28 b.jpg

WriteInfo 를 사용했을 때 바뀐 메타데이터 입니다.

BlueTRC
FileAccessDate
FileInodeChangeDate
FileModifyDate
FileName    <- 제가 바꾼거
GreenTRC
RedTRC
Software    <- 제가 바꾼거

Image::ExifTool 에서는 MIME type 이 application/dicomDICOMwrite 기능이 지원되지 않습니다. 문서에도 그렇고 테스트 결과도 그렇습니다. 다른 write 가 지원되는 포맷과 어떻게 다른지 탐구생활 해보도록 하겠습니다.

@aanoaa
Copy link
Author

aanoaa commented Jun 16, 2013

위에 두개 사용하니까 잘됩니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment