[gen] Improved search abilities. [pod] Bugfix: import several times an image from the same URL.

This commit is contained in:
Gaetan Delannay 2013-02-18 15:03:26 +01:00
parent 2307a284cc
commit 24089ef674
9 changed files with 103 additions and 39 deletions

View file

@ -174,6 +174,8 @@ pxToCm = 44.173513561
def getSize(filePath, fileType):
'''Gets the size of an image by reading first bytes.'''
x, y = (None, None)
# Get fileType from filePath if not given.
if not fileType: fileType = os.path.splitext(filePath)[1][1:]
f = file(filePath, 'rb')
if fileType in jpgTypes:
# Dummy read to skip header ID