creating a new TIFF tag field ?
Mostrar comentarios más antiguos
Hi everyone, I would like to create a new Tag entry in TIFF metadata. I tried :
tags.angle_roll = 0.5698;
geotiffwrite('test1.tif', A, R,'TiffTags',tags);
And I get the error :
Expected TiffTags.angle_roll to match one of
these strings:
'Artist', 'Compression', 'Copyright', 'DateTime',
'DocumentName', 'DotRange', 'ExtraSamples',
'FillOrder', 'Group3Options', 'Group4Options',
'HalfToneHints', 'HostComputer', 'ICCProfile',
'ImageDepth', 'ImageDescription', 'InkNames',
'InkSet', 'JPEGColorMode', 'JPEGQuality', 'Make',
'MaxSampleValue', 'MinSampleValue', 'Model',
'NumberOfInks', 'Orientation', 'PageName',
'PageNumber', 'PhotometricInterpretation',
'Photoshop', 'PlanarConfiguration',
'PrimaryChromaticities', 'ReferenceBlackWhite',
'ResolutionUnit', 'RichTIFFIPTC', 'RowsPerStrip',
'SGILogDataFmt', 'SMaxSampleValue',
'SMinSampleValue', 'SToNits', 'Software',
'TargetPrinter', 'Thresholding', 'TileLength',
'TileWidth', 'TransferFunction', 'WhitePoint',
'XMP', 'XPosition', 'XResolution',
'YCbCrCoefficients', 'YCbCrPositioning',
'YCbCrSubSampling', 'YPosition', 'YResolution',
'ZipQuality'
The input, 'angle_roll', did not match any of the
valid strings.
So is it impossible to create a new Tag entry in tif's metadata with matlab ?
Respuestas (3)
Geoffrey
el 22 de Abr. de 2016
Walter Roberson
el 21 de Abr. de 2016
0 votos
TIFF does not define its tags by name. TIFF tags are defined by numeric value, with any alphabetic name being for convenience.
To create a new tag, you will need to use TIFF settag() with a tag number 32768 or higher, and it being recommended to avoid the Adobe tags that have become effectively extensions. The alternative is to create a private IFD and put whatever tags one wants in there. What-ever you do you will need to coordinate with whatever has to read the file, since the names of the tags are not stored in the file.
1 comentario
Geoffrey
el 21 de Abr. de 2016
steve solomon
el 21 de Dic. de 2019
0 votos
I tried using a tag number 32768 or higher
> setTag(h,32769,'test tag')
and get the error message:
Error using tifflib
Tag number (32769) is unrecognized by the TIFF library.
Error in Tiff/setTag (line 1411)
tifflib('setField',obj.FileID,varargin{:});
it doesn't appear that new tags can be created using settag.
4 comentarios
Patrick Naulleau
el 1 de Abr. de 2020
Did this ever get resolved? I've run into the same problem
steve solomon
el 1 de Abr. de 2020
nope, and the more i read about the tiff header/metadata capabilities, the more disgusted i got. not using it for ANYTHING.
Patrick Naulleau
el 6 de Abr. de 2020
Editada: Patrick Naulleau
el 6 de Abr. de 2020
Thanks, very frustrating! I just learned that Labview's TIFF object can easily handle this. Also crazy that the TIFF object cannot even read private Tags whereas imfinfo has no problem on the reading side. How could this not be a priority for Matlab to address?
steve solomon
el 6 de Abr. de 2020
Mathsoft is entirely inscrutable. I've had numerous issues with their lack of and poor support for image formats. Had an ever worse time with the FITS standard. My understanding is that Python does significantly better in this regard, but open source brings its own set of headaches.
Categorías
Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!