PIL OSError [Errno 22] invalid Arguement
Verfasst: Freitag 16. März 2018, 14:02
Wenn ich mit PIL etwas speichern will dann gibt er mir öfters diese Fehlermeldung raus.
Hier ist der Code:
Wie ihr sieht muss das Programm das öfters speichern. Einige Namen funktionieren keinmal, einige einmal, einige zweimal. Aber kein einziges hat drei mal funktioniert. Was blöd ist, da das die Mindestvorraussetzung ist.
Ich habe hier einige Beispielnamen:
zweimal funktioniert:
A.png
name.png
einmal:
quax.png
name.jpg
A.jpg
garnicht:
quax1.png
Abcdefg.png
_.png
Wieso ist das so?
Hier ist der Code:
Code: Alles auswählen
while (xs,ys) != (xe,ye):
if xs > xe:
if ys > ye:
w = 100
h = 100
while w != 0:
while h != 0:
if Bild.getpixel((xs-w, ys-w)) == weiss:
wc = wc + 1
else:
sc = sc + 1
h = h - 1
h = 100
w = w - 1
if wc == 0:
inf = 100
while inf != 0:
xs = xs - 1
ys = ys - 1
Bild.putpixel ( (xs,ys), grun)
inf = inf -1
Bild.save('Abcdefg.png')
Ich habe hier einige Beispielnamen:
zweimal funktioniert:
A.png
name.png
einmal:
quax.png
name.jpg
A.jpg
garnicht:
quax1.png
Abcdefg.png
_.png
Wieso ist das so?