maflcko / wiki-java-tools

Collection of tools for MediaWiki in Java
26 stars 21 forks source link

Imker: Unique identifier? #22

Open mhulse opened 6 years ago

mhulse commented 6 years ago

Hello,

I'm running into some issues with the file name; I have a script that will obtain an image's meta data from the mediawiki API using the file name of the downloaded image.

This can cause me trouble as some of the image editing tools (i.e., Lightroom) export images with normalized extension of ".jpg". I run into issues if the original file name was ".jpeg" or ".JPG".

Rather than depend on on the image name, is there a unique ID property that could be used for a file name when Imker downloads an image? Heck, do WIKIs, like mediawiki, provide unique IDs for images?

Thanks!

mhulse commented 6 years ago

Unless I'm reading this wrong, it looks like maybe MD5 hash of file name might work:

https://commons.wikimedia.org/wiki/Commons:FAQ#What_are_the_strangely_named_components_in_file_paths.3F