Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'width' is not defined #24

Open
bemoregt opened this issue Jun 18, 2018 · 2 comments
Open

NameError: name 'width' is not defined #24

bemoregt opened this issue Jun 18, 2018 · 2 comments

Comments

@bemoregt
Copy link

Hi, @gskielian @vianamp

I have met this error

NameError: name 'width' is not defined

What's wrong with me?

Thanks in advance.

from @bemoregt.

@vcavallo
Copy link

This probably means that the width, height = Im.size line inside the for filename in FileList: line is never getting run (which probably means that the whole for block isn't happening.
Add some print lines above this to see what's empty. My money would be on FileList being an empty array, which probably means something is up with your directory structure.

@rmadrazo97
Copy link

rmadrazo97 commented May 6, 2020

@bemoregt
This happens because youre not on a MAC, hence, the DS_Store file doesn't exist and you're probably trying with only on image per directory. Try this:
for dirname in os.listdir(name[0]): # [1:] Excludes .DS_Store from Mac OS here it's removed. instead of : for dirname in os.listdir(name[0])[1:]:

-- late response but I was stuck on the same...

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

No branches or pull requests

3 participants