MCPcopy Create free account
hub / github.com/ActiveState/code / createImages

Method createImages

recipes/Python/271246_pyAlbumpy/recipe-271246.py:120–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118 img2.save(x)
119
120 def createImages(self):
121 # Create images for display in the files
122 os.chdir(self.dirName)
123 self.imagesDir = "images"
124 os.mkdir(self.imagesDir)
125 for x in os.listdir(self.dirName):
126 os.chdir(self.dirName)
127 if(os.path.isfile(x)):
128 image_size = Image.open(x).size
129 width = int(image_size[0] * self.scale2)
130 height = int(image_size[1] * self.scale2)
131 img = Image.open(x)
132 img2 = img.resize([width,height],2)
133 os.chdir(self.imagesDir)
134 img2.save(x)
135
136 def createCSS(self):
137 # Create CSS file

Callers 1

recipe-271246.pyFile · 0.80

Calls 7

chdirMethod · 0.80
mkdirMethod · 0.80
isfileMethod · 0.80
listdirMethod · 0.45
openMethod · 0.45
resizeMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected