remove non images early (#1007)
This commit is contained in:
1 parent
6f960aa1d0
commit
f41d5327e0
2 files changed
+16
-12
No files matched your search
@@ -48,12 +48,6 @@ class HTMLStripper(HTMLParser):
|
||||
def getImageFileName(imgfile):
|
||||
name, ext = os.path.splitext(imgfile)
|
||||
ext = ext.lower()
|
||||
if (name.startswith('.') and len(name) == 1):
|
||||
return None
|
||||
if name.startswith('._'):
|
||||
return None
|
||||
if ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.jp2', '.j2k', '.jpx']:
|
||||
return None
|
||||
return [name, ext]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user