Jump to content

Downconversion request (of an interesting example)


X___

Recommended Posts

This is going away from the original topic, but after a bit of trial and error (and prodding of ChatGPT), I came to the conclusion that there is no other way, in order to extract custom metadata from a PNG file, than to write a custom parser, as .NET only provides access to a series of predefined tags:

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/how-to-read-image-metadata?view=netframeworkdesktop-4.8

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.imaging.propertyitem.id?view=dotnet-plat-ext-7.0

There is a third party .NET framework to achieve that goal (https://products.groupdocs.com/metadata/net/extract/png/) but at $1,700 a year per license, I guess the motivation isn't there...

Link to comment
9 hours ago, ShaunR said:

Didn't your AI guru suggest exiv2?

No, it did not. It did mention that groupdocs was not free though!

What puzzles me is that it did not mention that this was a standard feature of the python PIL package:

from PIL import Image
import matplotlib.pyplot as plt

filename = '/content/drive/MyDrive/my image.png' # point to the image
im = Image.open(filename)
im.load()
plt.imshow(im)
plt.show()

print(im.info)
print('Metadata Field: ', im.info['Metadata Field'])

which is probably the approach I will use in my migration to Python experiment.

Link to comment
13 hours ago, X___ said:

No, it did not. It did mention that groupdocs was not free though!

What puzzles me is that it did not mention that this was a standard feature of the python PIL package:

from PIL import Image
import matplotlib.pyplot as plt

filename = '/content/drive/MyDrive/my image.png' # point to the image
im = Image.open(filename)
im.load()
plt.imshow(im)
plt.show()

print(im.info)
print('Metadata Field: ', im.info['Metadata Field'])

which is probably the approach I will use in my migration to Python experiment.

You've really been gulping down that AI coolade, huh? :D

I was going to mention PIL but IIRC it only supports standard tags (like the .NET that you criticized) so didn't bother to mention it.

 

Link to comment
8 hours ago, ShaunR said:

You've really been gulping down that AI coolade, huh? :D

I was going to mention PIL but IIRC it only supports standard tags (like the .NET that you criticized) so didn't bother to mention it.

 

Koolaid? Not really. I like the sifting through stackexchange, distilling it to the necessary stuff and providing link to the source in case of doubts.

PIL does return custom metadata (at least text ones) just fine.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.