Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os
- from gimpfu import *
- def batch_convert(img, layer, inputFolder, outputFolder):
- # Iterate the folder
- for file in os.listdir(inputFolder):
- try:
- # Build the full file paths.
- inputPath = inputFolder + "\\" + file
- outputPath = outputFolder + "\\" + file
- # Open the file if is a DDS image.
- image = pdb.file_dds_load(inputPath, inputPath, 0, 0)
- pdb.file_dds_save(image, drawable, outputPath, outputPath, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1)
- except Exception as err:
- gimp.message("Unexpected error: " + str(err))
- register(
- "python_fu_test_batch_convert",
- "Batch Convert",
- "Converts DDS to DTX5 W Mipmaps",
- "JT",
- "Open source (BSD 3-clause license)",
- "2013",
- "<Image>/Filters/Test/Batch invert",
- "*",
- [
- (PF_DIRNAME, "inputFolder", "Input directory", ""),
- (PF_DIRNAME, "outputFolder", "Output directory", "")
- ],
- [],
- batch_convert)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement