Skip to content

Handle filename contains multiple "."#23

Open
ntvthuyen wants to merge 3 commits intoaqeelanwar:masterfrom
ntvthuyen:patch-1
Open

Handle filename contains multiple "."#23
ntvthuyen wants to merge 3 commits intoaqeelanwar:masterfrom
ntvthuyen:patch-1

Conversation

@ntvthuyen
Copy link
Copy Markdown

split_path = f.rsplit(".") only can't handle filenames that contain more than "." Ex: file.30.26.jpg
It will produce an opencv write error. (It will try to cv.imwrite("file.30",img ).
In this modification, I join all elements of split_path array from the start to (n - 1) th to create new split_path with just 2 elements.
Ex: file.30.26.jpg -> ["file","30","26","jpg"] -> ["file.30.26","jpg"]

split_path = f.rsplit(".") only can't handle filenames that contain more than "." Ex: file.30.26.jpg
It will produce an opencv write error. (It will try to cv.imwrite("file.30",img ).
In this modification, I join all elements of split_path array from the start to (n - 1) th to create new split_path with just 2 elements.
Ex: file.30.26.jpg -> ["file","30","26","jpg"] -> ["file.30.26","jpg"]
Copy link
Copy Markdown

@tintinmaster tintinmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same line split_path = [".".join(split_path[:-1]),split_path[-1]] is also needed in line 172

Comment thread mask_the_face.py Outdated
ntvthuyen and others added 2 commits November 9, 2022 19:47
Co-authored-by: Tim Schneider <tim.schneider1337@gmail.com>
Copy link
Copy Markdown
Author

@ntvthuyen ntvthuyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update line 172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants