nsfwalex commited on
Commit
52826a5
·
1 Parent(s): 5697085

update helper

Browse files
Files changed (1) hide show
  1. helper.py +3 -3
helper.py CHANGED
@@ -219,16 +219,16 @@ def save_image(img, flag=""):
219
  if not os.path.exists(path):
220
  os.makedirs(path)
221
  if flag:
222
- flag = "_" + flag
223
  # Generate a unique filename
224
  unique_name = str(uuid.uuid4()) + flag + ".webp"
225
  unique_name = os.path.join(path, unique_name)
226
-
227
  # Convert the image to WebP format
228
  webp_img = img.convert("RGB") # Ensure the image is in RGB mode
229
 
230
  # Save the image in WebP format with high quality
231
- webp_img.save(unique_name, "WEBP", quality=90)
232
 
233
  # Open the saved WebP file and return it as a PIL Image object
234
  with Image.open(unique_name) as webp_file:
 
219
  if not os.path.exists(path):
220
  os.makedirs(path)
221
  if flag:
222
+ flag = "_" + flag
223
  # Generate a unique filename
224
  unique_name = str(uuid.uuid4()) + flag + ".webp"
225
  unique_name = os.path.join(path, unique_name)
226
+
227
  # Convert the image to WebP format
228
  webp_img = img.convert("RGB") # Ensure the image is in RGB mode
229
 
230
  # Save the image in WebP format with high quality
231
+ webp_img.save(unique_name, "WEBP", quality=100)
232
 
233
  # Open the saved WebP file and return it as a PIL Image object
234
  with Image.open(unique_name) as webp_file: