불행하게도, 그것은 보인다.
이유에 대해 discussion in the libtiff mailing list이 있습니다.
// FIXME -- we don't currently support writing of EXIF fields. TIFF
// in theory allows it, using a custom IFD directory, but at
// present, it appears that libtiff only supports reading custom
// IFD's, not writing them.
레너드 Rosenthol :
I don't really think that libTIFF really wants to start down the
metadata "rabbit hole"...
밥 Friesenhahn 다음은 토론에서 일부 인용 부호가있는 Unknown tag EXIF_USERCOMMENT
, 당신이해야 read an EXIF directory first에 관해서는
I do agree with Leonard Rosenthol that libtiff should not be in the
business of dealing with EXIF private IFD tags (even though it
somewhat does already).
. 라이브러리는 EXIF 디렉토리를 읽기 전에 알려진 태그 목록에 EXIF 태그를 추가하고 나중에 알 수없는 태그에 대한 오류를 발행하지 않습니다.
그러나 라이브러리는 여전히 EXIF 태그를 파일에 쓸 수 없습니다.
편집 :
당신은 단지 당신의 파일에 일부 정보를 저장하고이 EXIF_USERCOMMENT
태그에 저장 될 필요가하려는 경우 몇 가지 옵션이 있습니다.
IMAGEDESCRIPTION
태그를 작업에 사용할 수 있습니다. 다음은이 태그를 사용하는 샘플 코드입니다. 이 코드는 Open
메서드에 대해 다른 매개 변수를 사용하며 WriteDirectory
대신 RewriteDirectory
을 사용합니다.
string fileName = "C:\\temp\\~tempCapture.tif";
using (Tiff tiffdoc = Tiff.Open(fileName, "a"))
{
tiffdoc.SetDirectory(0);
bool bSetField = tiffdoc.SetField(TiffTag.IMAGEDESCRIPTION, "test comment field");
tiffdoc.RewriteDirectory();
}
라이브러리는 콘솔에 경고 및 오류를 기록합니다. 여기에 게시 할 수 있습니까? – Bobrovsky
SetField : c : \ temp \ ~ tempCapture.tif : 알 수없는 태그 EXIF_USERCOMMENT – MartinJPLAJP
감사합니다. EXIF를 처음 접했을 때 나는 분명히 뭔가 빠졌을 것입니다. :) – MartinJPLAJP