Найти - Пользователи
Полная версия: Скрипт не работает на сервере
Начало » Python для новичков » Скрипт не работает на сервере
1
Areostar
вот скриптик

 from PIL import Image
import struct
import os
source_path = "data/source"
result_path = "data/result"
def cloneWithColor(color):
    files = os.listdir(source_path)
    for file in files:
        image = Image.open(source_path+'/'+file)
        image = image.convert('RGBA')
        color_tuple = struct.unpack('BBBB',struct.pack('I',int("0x"+color[1:], 16)))[:3]
        for i in range(image.size[0]):
            for j in range(image.size[1]):
                a = image.getpixel((i,j))[3]
                image.putpixel((i, j), ((color_tuple[0], color_tuple[1], color_tuple[2], a)))
        print(result_path+"/"+file[0: -4]+color+file[-4:])
        image.save(result_path+"/"+file[0: -4]+color+file[-4:])
cloneWithColor('#0fa1a3')

редактирует изображения и копирует их в другую папку.
На локалке работает блестяще. на сервере отратывает но копии не создаются!


В чем могут быть проблема?
Areostar
права доступа не все папки 777
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB