Thread:Manuel de la Fuente/@comment-36009152-20190413234431/@comment-5774380-20190417171547

I'm sure that almost everyone in the dev wiki have an idea of how to do this and probably some better methods than what I have in mind; but if you want me to tell you how I would do it, you'd require this:


 * 1) Option for the user to input the list of images to convert (or fetching it via the API according to certain parameters, like getting all images of a certain format).
 * 2) Afterwards, the script gets the list of all pages each image is included in.
 * 3) This is the trickiest part: the script downloads each image and passes it through a third-party utility that converts it and returns a copy of the desired format. You'd have to look for a JavaScript utility for image conversion. You'd probably have to experiment with a few to see which is better for your purposes, which has the best quality/size/conversion time ratio, and setting some timeouts to avoid being blocked by Wikia if you happen to download too many files too fast. If you're working with a large number of images, an utility that runs on the cloud rather than on the user's browser may be preferable for bandwidth and memory reasons.
 * 4) The script uploads the converted image to the wiki and copies its file information.
 * 5) It replaces the file in all pages that were using the old one.
 * 6) Finally, it deletes the old image (meaning it'd require to be run from an account with Content Moderator rights at the least).