| 155 | fp.close() |
| 156 | |
| 157 | def createIndex(self): |
| 158 | # Create the index file |
| 159 | self.indexFile = "index.htm" |
| 160 | os.chdir(self.dirName) |
| 161 | fp = open(self.indexFile,"w") |
| 162 | temp = """<html> |
| 163 | <head> |
| 164 | <title>%s</title> |
| 165 | <link rel="stylesheet" href="%s/styles.css"> |
| 166 | </head> |
| 167 | <body> |
| 168 | <center><h2>%s</h2></center> |
| 169 | <table align="center"><tr> |
| 170 | """ % (self.title, self.slideName, self.title) |
| 171 | self.count = 0 |
| 172 | for x in self.files: |
| 173 | image_size = Image.open(x).size |
| 174 | file_size = int(os.stat(x)[6]/1024) |
| 175 | width = int(image_size[0]) |
| 176 | height = int(image_size[1]) |
| 177 | if self.count == 0 : |
| 178 | temp = temp + "</tr><tr>" |
| 179 | temp = temp + "<td valign=\"bottom\" align=\"center\" style=\"text-align:center\"><a href=\"" + self.slideName + "/" + self.slideName + x + ".htm" + "\"><img src=\"" + self.tnDir + "/" + x + "\"><br>" + x + "</a><br><span style=\"color:gray\"><small>" + str(width) + "×" + str(height) + ", " + str(file_size) + "kB</small></span> </td>" |
| 180 | self.count = self.count + 1 |
| 181 | if self.count == 4: |
| 182 | self.count = 0 |
| 183 | temp = temp + "</tr></table>\n<p style=\"padding-left:10px\"><small>Created using <a href=\"http://premshree.resource-locator.com/python/pyAlbum.py\"><small>pyAlbum.py</small></a></small></p>\n</body>\n</html>" |
| 184 | fp.write(temp) |
| 185 | fp.close() |
| 186 | |
| 187 | def exifInfo(self, fileName): |
| 188 | os.chdir(self.dirName) |