-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File extension missing #68
Comments
@Klortho @wrought is it possible to do this in xsl transform? We currently do not modify the output of the transform, so in order to add filenames we would have to start treating the xsl output in python. That's fine if that's the only way, but it does not make the xsl conversion self-contained. It's is as simple as just append.jpg, or .png, only that one has to check for the existence of each one, since images are not gauranteed to come in any specific format. |
Here's a sample figure in the
Most importantly, the
As you can see, there is no extension stored in this element for this version of the article. However, image files are provided with the rest of the tarball where we find the
|
I think we should go with OAMI here. |
I agree with that. |
Can someone elaborate on why file extensions are needed on MediaWiki? |
From OAMI source code: #TODO: file extension should be adapted for other file formats url_path = urlparse.urlsplit(material.url).path source_filename = url_path.split('/')[-1] assert(mimetype in ('audio', 'video')) if mimetype == 'audio': extension = 'oga' elif mimetype == 'video': extension = 'ogv' wiki_filename = path.splitext(source_filename)[0] + '.' + extension |
Ok, I've updated our code to search only for jpg and pngs per advice above. |
The media files to be embedded should have the correct file name suffix by default, so that edits like
https://en.wikisource.org/w/index.php?title=Biodiversity_Assessment_of_the_Fishes_of_Saba_Bank_Atoll%2C_Netherlands_Antilles&diff=4736919&oldid=4736916
are not necessary any more.
That would be a precursor to #8.
The text was updated successfully, but these errors were encountered: