-  [Acasă] [Chat] [wiki] [RSS] [bash]

[Înapoi]
Răspuns
Nume
Functie   |     |  
Subiect   (răspuns la 369)
Mesaj
Fişier
Remote Upload
Embed   Help
Parola  (pentru ştergerea mesajului)
  • Fişierele permise sunt: GIF, JPG, PNG, RAR, ZIP
  • Dimensiune maximă pentru fişiere este 5120 KB.
  • Imaginile mai mari de 200x200 vor fi redimensionate.
  • 202 răspuns(uri) unic(e).


/prog/ - ratați-mi codul from PIL import Image import glob import os #extensions to look for file_types = ("*.jpg", "*.jpeg", "*
142169095524.png - (87.85KB , 681x640 , Screenshot from 2015-01-19 20:03:07.png )
369 No. 369
ratați-mi codul

from PIL import Image import glob import os #extensions to look for file_types = ("*.jpg", "*.jpeg", "*tif", "*tiff", "*.png", "*.bmp") #list to keep found files in image_list = [] #add files to list for images in file_types: image_list.extend(glob.glob(images)) #set maximum W x H maxW = 1920 maxH = 1920 def ResizeImages(image_list) : if not os.path.exists("done"): os.makedirs("done") for image in image_list : img = Image.open(image) width = img.size[0] height = img.size[1] ratio = float(width) / float(height) if width > maxW : height = int(maxW / ratio) resized = img.resize((maxW,height), Image.ANTIALIAS) image = os.path.splitext(image)[0] resized.save("done/" + image + ".jpg", format="JPEG", quality=90) elif height > maxH : width = int(maxW * ratio) resized = img.resize((width,maxH), Image.ANTIALIAS) image = os.path.splitext(image)[0] resized.save("done/" + image + ".jpg", format="JPEG", quality=90) else : image = os.path.splitext(image)[0] img.save("done/" + image + ".jpg", format="JPEG", quality=90) ResizeImages(image_list)

Măreşte toate imaginile
>> No. 370
>>369
nu-i rau ... chiar nu-i rau ... pana si editorul e sublim ...
>> No. 371
pot spune ca esti "mr default" la cum arata editorul tau. 0 customizari, probabil faci asta ca hobby

te RATEZ ca 4/10

>> No. 372
>>371
arata-ne ce customizari se fac ... ce imbunatatiri cacat ... show us the way ...
>> No. 373
14216981357.png - (104.78KB , 724x749 , Screenshot from 2015-01-19 22:08:47.png )
373
>>371
uhm...

am zis sa-mi ratezi codul nu editorul


Şterge mesajul []
Parola  
Report post
Motiv  


▲ ▼