Board Thread:JS Development/@comment-36009152-20190417205533

Whether already created, or if it can be made may I know how I could use a bot (currently has these) using JS to convert the .jpg Images in image galleries to .png format? They are already in one area so can be done gallery by gallery. There is a working method using a regular bot program, which would require: Figured find and replace could be used to input the .jpg images (extra handy if it could detect them and add rather then adding manually, but anything that works is already better than perfect). Adding images to categories already updates them across the pages for point 2. So whatever does that can be used for the image converting.
 * 1) An 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.

3. An actual .jpg to .png converter is what is needed. Does Fandom have it’s own script prepared or can this part of the bot program be linked with good external ones? If the best ones are known please share them, converting twenty at a time gradually is nice and all, but nicer is always… nicer! The same timer used when images are being added to categories could be used here to prevent a too rapid fire upload.

4. If the images are not already uploaded if the conversion does not occur there on the wiki, then all I can suggest is linking with a wikis multi uploader. Preferably a script however long to ensure the huge amount of images can be added, and minimising the risk it could be cancelled or something.

Point 5. Would need maybe an extension of find and replace if this is all to be an automatic process meant to flow uninterrupted.

Point 6. Is an excellent addition and great idea to include all into one. If it does prove too much to have all in one this could be left. Mass delete could simply be done after the process to remove the previous .jpg images, whichever works best.

Rather than download each and every image (there are a ton, possibly literally) converting, re-uploading… to use a bot to do it all on the wiki, and much faster would be a best thing ever, more so for creating the JS addition of this amazing feature.

Do hope this use a JS bot to convert .jpg images to .png format on wikis can be made! 