mirror of
https://github.com/ivanch/tcc.git
synced 2025-08-25 15:21:49 +00:00
consertos flask
This commit is contained in:
@@ -28,20 +28,15 @@ def box_blur_image_separable(image, blurred_image, radius_x, radius_y):
|
||||
|
||||
return blurred_image
|
||||
|
||||
|
||||
def save_image(file_stream):
|
||||
with open("image.png", "wb") as file:
|
||||
file.write(file_stream.read())
|
||||
file.close()
|
||||
|
||||
class ImageService:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def box_blur_image(self, img, radius):
|
||||
with Image(filename=img) as image:
|
||||
image = image.blur(radius, 0)
|
||||
image = image.blur(0, radius)
|
||||
with Image(blob=img) as image:
|
||||
blurred_image = image.clone()
|
||||
image = box_blur_image_separable(image, blurred_image, radius, 0)
|
||||
image = box_blur_image_separable(image, blurred_image, 0, radius)
|
||||
return image
|
||||
|
||||
def get_simple_image(self):
|
||||
@@ -53,4 +48,5 @@ class ImageService:
|
||||
return file.read()
|
||||
|
||||
def save_image(self, img):
|
||||
save_image(img)
|
||||
with open("image.png", "wb") as file:
|
||||
file.write(img)
|
||||
|
Reference in New Issue
Block a user