Hi,
I want to extract (and later also edit) IPTC information from a .jpg file.
I found this:
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files - GitHub - drewnoakes/metadata-extractor-dotnet: Extracts Exif, IPTC, XMP, ICC and other metadata from image, vide...
It looks like exactly what I need Except I don’t know how to use it as I’m quite new to UiPath.
I installed the package “MetadataExtractor” but I don’t see it in my installed activities.
Also I don’t know which Variable Type to assign (IEM Directory???
This is the example code from the site:
IEnumerable directories = ImageMetadataReader.ReadMetadata(imagePath);
Can somebody help me? If somebody has a better plan to extract and edit IPTC information, that is also cool
Thanks!
Yoichi
(Yoichi)
June 27, 2023, 11:34pm
2
Hi,
Can you try the following sample?
Sample20230628-1.zip (97.7 KB)
Regards,
Thanks! It works!!
I have some questions for my understanding and learning purposes:
how did you know that metadatalist is this type and how did you select it in Studio?
<?xml version="1.0" encoding="utf-16"?>
How did you know that this would be the correct method:
CDynamic.MetaExtractor.ImageMetadataReader.ReadMetadata(targetFile)
The github page does not mention this piece of code.
and last question
now it is an read only list - meaning I cannot edit the metadata. Do you know a way of editing this?
I want to edit the IPTC metadata (“keywords”) / add keywords.
Thanks again!!
Yoichi
(Yoichi)
June 28, 2023, 4:39am
5
Hi,
how did you know that metadatalist is this type and how did you select it in Studio ?
We can know it from complementary function as the following.
Then choose IReadOnlyList
IReadOnlyList is standard .net class and we can easily choose it.
And we can easily estimate this Directory is from CDynamic.MetaExtractor
How did you know that this would be the correct method:
CDynamic.MetaExtractor.ImageMetadataReader.ReadMetadata(targetFile)
I used the above expression because you suggests in original post. (Just add Namespace)
now it is an read only list - meaning I cannot edit the metadata. Do you know a way of editing this?
I want to edit the IPTC metadata (“keywords”) / add keywords.
i think this package is just extractor (reader). So if you need to modify it, perhaps you need to use other library.
Regards,
1 Like
Yoichi
(Yoichi)
June 29, 2023, 4:02am
7
HI,
We can find CDynamics.MetaExtractro namespace if search by “ImageMetadataReader” as the following image
Regards,
thanks for helping! @Yoichi
1 Like
system
(system)
Closed
July 4, 2023, 5:57pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.