saving file permission denied on windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zombek@gmail.com

    #1

    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.o utput)
    .....
    img = Image.open(os.p ath.join(self.d ir,file))
    img = img.resize(self .imgSize)
    # and here comes the error
    img.save(self.o utput, "JPEG", optimize=1)

    IOError: [Errno 13] Permission Denied
    "D:\\Szymek\\py thon\\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.

  • defcon8

    #2
    Re: saving file permission denied on windows

    Have you checked the persmissions to the folder? You can look from the
    properties of the folder to see.

    Comment

    • zombek@gmail.com

      #3
      Re: saving file permission denied on windows

      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

      Comment

      • Larry Bates

        #4
        Re: saving file permission denied on windows

        zombek@gmail.co m wrote:[color=blue]
        > 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.o utput)
        > ....
        > img = Image.open(os.p ath.join(self.d ir,file))
        > img = img.resize(self .imgSize)
        > # and here comes the error
        > img.save(self.o utput, "JPEG", optimize=1)
        >
        > IOError: [Errno 13] Permission Denied
        > "D:\\Szymek\\py thon\\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.
        >[/color]
        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\\py thon\\pythumb\\ images\\proba"

        You most likely meant:

        img.save(os.pat h.join(self.out put, file), "JPEG", optimize=1)

        -Larry Bates

        Comment

        • zombek@gmail.com

          #5
          Re: saving file permission denied on windows

          That's right! I just didn't notice it.
          Thank you

          Comment

          Working...