mirror of
https://github.com/tanrax/guetzli-recursively.git
synced 2024-11-09 22:45:41 +01:00
fixbug type file
This commit is contained in:
parent
c70ed2bbf5
commit
7b2c882f66
@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from os import path, walk, remove, rename
|
||||
from imghdr import what
|
||||
from subprocess import call
|
||||
from sys import argv
|
||||
top_dir = argv[1]
|
||||
TEMP_FILE = 'temp.jpg'
|
||||
extensions = ('jpeg', 'jpg')
|
||||
TYPES = ('jpeg',)
|
||||
|
||||
for dirpath, dirnames, files in walk(top_dir):
|
||||
for name in files:
|
||||
for extension in extensions:
|
||||
if name.lower().endswith(extension):
|
||||
if what(path.join(dirpath, name)) in TYPES:
|
||||
# Get urls
|
||||
url = path.join(dirpath, name)
|
||||
print(url)
|
||||
|
Loading…
Reference in New Issue
Block a user