read_image_metadataread_image_metadataReadImageMetadataReadImageMetadataread_image_metadata (Operator)

Name

read_image_metadataread_image_metadataReadImageMetadataReadImageMetadataread_image_metadata — Read metadata from image files.

Signature

read_image_metadata( : : Format, TagName, FileName : TagValue)

Herror read_image_metadata(const char* Format, const char* TagName, const char* FileName, char* TagValue)

Herror T_read_image_metadata(const Htuple Format, const Htuple TagName, const Htuple FileName, Htuple* TagValue)

void ReadImageMetadata(const HTuple& Format, const HTuple& TagName, const HTuple& FileName, HTuple* TagValue)

static HTuple HImage::ReadImageMetadata(const HString& Format, const HTuple& TagName, const HString& FileName)

static HTuple HImage::ReadImageMetadata(const char* Format, const HTuple& TagName, const char* FileName)

static HTuple HImage::ReadImageMetadata(const wchar_t* Format, const HTuple& TagName, const wchar_t* FileName)   ( Windows only)

static void HOperatorSet.ReadImageMetadata(HTuple format, HTuple tagName, HTuple fileName, out HTuple tagValue)

static HTuple HImage.ReadImageMetadata(string format, HTuple tagName, string fileName)

def read_image_metadata(format: str, tag_name: str, file_name: str) -> Union[int, float, str]

Description

The operator read_image_metadataread_image_metadataReadImageMetadataReadImageMetadataread_image_metadata reads the metadata of the file FileNameFileNameFileNamefileNamefile_name and returns the information in TagValueTagValueTagValuetagValuetag_value. With TagNameTagNameTagNametagNametag_name you specify, for which single tag or tuple of tags you want to retrieve the information. The parameter FormatFormatFormatformatformat specifies, in which format the metadata is encoded.

This operators supports for FormatFormatFormatformatformat the TIFF metadata formats 'tiff'"tiff""tiff""tiff""tiff" and 'bigtiff'"bigtiff""bigtiff""bigtiff""bigtiff". The file extension .tif is expected.

The following tags are readable:
TagNameTagNameTagNametagNametag_name TagValueTagValueTagValuetagValuetag_value data type
'tiff_aperture_value'"tiff_aperture_value""tiff_aperture_value""tiff_aperture_value""tiff_aperture_value" double
'tiff_copyright'"tiff_copyright""tiff_copyright""tiff_copyright""tiff_copyright" string
'tiff_date_time'"tiff_date_time""tiff_date_time""tiff_date_time""tiff_date_time" string
'tiff_exposure_time'"tiff_exposure_time""tiff_exposure_time""tiff_exposure_time""tiff_exposure_time" double
'tiff_image_description'"tiff_image_description""tiff_image_description""tiff_image_description""tiff_image_description" string
'tiff_light_source'"tiff_light_source""tiff_light_source""tiff_light_source""tiff_light_source" integer
'tiff_make'"tiff_make""tiff_make""tiff_make""tiff_make" string
'tiff_software'"tiff_software""tiff_software""tiff_software""tiff_software" string
Note, the operator returns an error in case the tag specified by TagNameTagNameTagNametagNametag_name has no value set.

You can retrieve all readable tags with the string 'tiff_tags_supported_for_reading'"tiff_tags_supported_for_reading""tiff_tags_supported_for_reading""tiff_tags_supported_for_reading""tiff_tags_supported_for_reading" for TagNameTagNameTagNametagNametag_name as well as retrieve all writable tags with the string 'tiff_tags_supported_for_writing'"tiff_tags_supported_for_writing""tiff_tags_supported_for_writing""tiff_tags_supported_for_writing""tiff_tags_supported_for_writing". Each of both strings can be used only as single value for TagNameTagNameTagNametagNametag_name.

Execution Information

Parameters

FormatFormatFormatformatformat (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Graphic format.

Default: 'tiff' "tiff" "tiff" "tiff" "tiff"

Suggested values: 'tiff'"tiff""tiff""tiff""tiff", 'bigtiff'"bigtiff""bigtiff""bigtiff""bigtiff"

TagNameTagNameTagNametagNametag_name (input_control)  tuple HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the tag to be written in the image file.

Default: 'tiff_image_description' "tiff_image_description" "tiff_image_description" "tiff_image_description" "tiff_image_description"

Suggested values: 'tiff_image_description'"tiff_image_description""tiff_image_description""tiff_image_description""tiff_image_description", 'tiff_make'"tiff_make""tiff_make""tiff_make""tiff_make", 'tiff_software'"tiff_software""tiff_software""tiff_software""tiff_software", 'tiff_date_time'"tiff_date_time""tiff_date_time""tiff_date_time""tiff_date_time", 'tiff_copyright'"tiff_copyright""tiff_copyright""tiff_copyright""tiff_copyright", 'tiff_exposure_time'"tiff_exposure_time""tiff_exposure_time""tiff_exposure_time""tiff_exposure_time", 'tiff_aperture_value'"tiff_aperture_value""tiff_aperture_value""tiff_aperture_value""tiff_aperture_value", 'tiff_light_source'"tiff_light_source""tiff_light_source""tiff_light_source""tiff_light_source", 'tiff_tags_supported_for_reading'"tiff_tags_supported_for_reading""tiff_tags_supported_for_reading""tiff_tags_supported_for_reading""tiff_tags_supported_for_reading", 'tiff_tags_supported_for_writing'"tiff_tags_supported_for_writing""tiff_tags_supported_for_writing""tiff_tags_supported_for_writing""tiff_tags_supported_for_writing"

FileNameFileNameFileNamefileNamefile_name (input_control)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of image file.

File extension: .tif, .tiff

TagValueTagValueTagValuetagValuetag_value (output_control)  tuple HTupleUnion[int, float, str]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Output tag value read from the image file.

Result

If TagValueTagValueTagValuetagValuetag_value can be correctly read for the specified input parameters the operator read_image_metadataread_image_metadataReadImageMetadataReadImageMetadataread_image_metadata returns the value 2 ( H_MSG_TRUE) . Otherwise an exception is raised. In this case, an extended error information, as e.g., the causative tag, may be set and can be queried with the operator get_extended_error_infoget_extended_error_infoGetExtendedErrorInfoGetExtendedErrorInfoget_extended_error_info.

Possible Predecessors

write_image_metadatawrite_image_metadataWriteImageMetadataWriteImageMetadatawrite_image_metadata

Possible Successors

read_imageread_imageReadImageReadImageread_image

Module

Foundation