467,161 Members | 861 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,161 developers. It's quick & easy.

saving file permission denied on windows

I'm making a small program which takes a folder with images and
generates optimized normal-sized images and thumbnails using Python
Imaging Lbrary (PIL). The problem is here:
.....
os.mkdir(self.output)
.....
img = Image.open(os.path.join(self.dir,file))
img = img.resize(self.imgSize)
# and here comes the error
img.save(self.output, "JPEG", optimize=1)

IOError: [Errno 13] Permission Denied
"D:\\Szymek\\python\\pythumb\\images\\proba"

I don't know what's going on, I didn't have any problems with it in the
past. I tried to save it to a pre-made directory but the effect is the
same, so I don't think it's connected with os.mkdir.

May 15 '06 #1
  • viewed: 19428
Share:
4 Replies
Have you checked the persmissions to the folder? You can look from the
properties of the folder to see.

May 15 '06 #2
The permission is OK I guess... I don't see anything about permission
there, but I tried to save to maaaaaany other catalogs even to C:\ and
D:\ and it raised the same error

May 15 '06 #3
zo****@gmail.com wrote:
I'm making a small program which takes a folder with images and
generates optimized normal-sized images and thumbnails using Python
Imaging Lbrary (PIL). The problem is here:
....
os.mkdir(self.output)
....
img = Image.open(os.path.join(self.dir,file))
img = img.resize(self.imgSize)
# and here comes the error
img.save(self.output, "JPEG", optimize=1)

IOError: [Errno 13] Permission Denied
"D:\\Szymek\\python\\pythumb\\images\\proba"

I don't know what's going on, I didn't have any problems with it in the
past. I tried to save it to a pre-made directory but the effect is the
same, so I don't think it's connected with os.mkdir.

I think you have a logic problem.

You can't save to a folder name, you must save to a file. Note
that O/S is saying that permission is denied to the folder name
stored in self.output:

"D:\\Szymek\\python\\pythumb\\images\\proba"

You most likely meant:

img.save(os.path.join(self.output, file), "JPEG", optimize=1)

-Larry Bates
May 15 '06 #4
That's right! I just didn't notice it.
Thank you

May 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Richard Muller | last post: by
3 posts views Thread by David Thielen | last post: by
2 posts views Thread by jdlists@gmail.com | last post: by
11 posts views Thread by trs-ggcsea@simulakrum.com | last post: by
1 post views Thread by igotyourdotnet | last post: by
5 posts views Thread by Brian | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.