Click here to Skip to main content
15,913,101 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
I have a Jpeg image generated and rated using Paint Shop Pro 2019. Windows properties of the image show the Stars rating. But when I try to get the rating in Vb.Net like:

Dim propRating As PropertyItem
propRating = myImage.GetPropertyItem(18246)


the property is not found. Evidently it is not in the Exif, but where?

So please, I kindly ask: where in the image is the rating that Windows display in the properties? How can I get it?
I'm not interested in putting the rating in the Exif, I wish only grab the rating that Windows displays.

Thank you.
Paolo

PS 18246 is the decimal Id of the property.

What I have tried:

I've tried this code:
Dim propRating As PropertyItem
propRating = myImage.GetPropertyItem(18246)


Note: this code works fine if I impose the rating directly in the Windows properties.
Posted
Updated 11-Apr-21 5:52am
Comments
Richard Deeming 29-Mar-21 9:37am    
Could PSP be setting the RatingPercent property instead? (18249)
Member 15072299 30-Mar-21 7:51am    
No, I checked this too.
It seems that PSP stores the rating outside the Exif. Maybe I have to search something like a XMP format?
But in the meanwhile I have found that exists a Windows.Storage.FileProperties that contains a ImageProperties.Rating Property.
Surely PSP stores rating there and I have to reach that place.

1 solution

The rating is stored in the XMP block. This is a text block and it contains a statement like:

<xmp:rating>3</xmp:Rating>

I have written a library, that can only remove the XMP block. The removal is done, when you save the EXIF data of the image file using the method "Save" and passing the option parameter "ExifSaveOptions.RemoveAdobeInfoBlock". But you can debug the Save method in order to see, how the XMP block is embedded into the JPEG file. And then you can write a method which reads the XMP block instead of removing it.

CompactExifLib: Access to EXIF Tags in JPEG Files[^]

Best Regards
Hans-Peter
 
Share this answer
 
v2
Comments
Member 15072299 12-Apr-21 3:04am    
Thank you Hans.
I'll try.
For now I'm always thinking to reach via VB Express 2010 the so called Windows.Storage.FileProperties (https://docs.microsoft.com/en-us/uwp/api/windows.storage.fileproperties?view=winrt-19041) that contains a ImageProperties.Rating Property.
Thank you again.
Paolo

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900