Created
January 14, 2013 08:35
-
-
Save aviramsegal/4528623 to your computer and use it in GitHub Desktop.
Gimp Python-Fu Script for setting DPI for PNG Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, glob | |
import string | |
from gimpfu import * | |
mime_type = 'png'; | |
path = '/home/avirams/Dropbox/articles/WebSphere Scheduler/images' | |
# here we do a foreach loop | |
for infile in glob.glob( os.path.join(path, '*.' + mime_type) ): | |
image = pdb.gimp_file_load(infile, '1') | |
pdb.gimp_image_set_resolution(image, 116, 120) | |
temp_list = infile.split('/') | |
filename = temp_list.pop() | |
new_path = '//home/avirams/Dropbox/articles/WebSphere Scheduler/images116120/' + filename | |
pdb.gimp_file_save(image, drawable, new_path, 'Saved image') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment