handle paths and extensions properly, fix #41
This commit is contained in:
parent
657ced1ceb
commit
0ecc0ecd3a
@ -138,9 +138,9 @@ def create_event_post(post_dir, event):
|
||||
for img in event_metadata["images"]:
|
||||
|
||||
# parse img url to safe local image name
|
||||
img_name = img.split("/")[-1]
|
||||
fn, ext = img_name.split(".")
|
||||
img_name = slugify(fn) + "." + ext
|
||||
img_name = os.path.basename(img)
|
||||
fn, ext = os.path.splitext(img_name)
|
||||
img_name = slugify(fn) + '.' + ext
|
||||
|
||||
local_image = os.path.join(post_dir, img_name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user