-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b816844
commit 9be8076
Showing
54 changed files
with
471 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from utilities.response import res500, res200, res400 | ||
from utilities.utils import convert_image_format | ||
from conf.setting import settings | ||
from webview import SAVE_DIALOG, OPEN_DIALOG | ||
import webview | ||
import time | ||
|
||
|
||
class ConvertImageAPI: | ||
name = "convert_image" | ||
|
||
def get_convert_image(self, playload): | ||
try: | ||
input_path = playload["input_path"] | ||
output_format = playload["output_format"] | ||
except KeyError: | ||
return res500("Invalid input") | ||
filename = f"[{settings.TOOL_NAME}]-{int(time.time()*1000)}-output.{output_format.lower()}" | ||
result = self.open_save_dialog( | ||
filename, | ||
) | ||
if not result: | ||
return res200(msg="Cancel") | ||
flag = convert_image_format(input_path, output_format, result) | ||
if flag: | ||
return res200(msg="Success") | ||
else: | ||
return res400(msg="Cancel") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/web/assets/AIMattingHome-DSIaSJA6.js → backend/web/assets/AIMattingHome-BYTxmkWk.js
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.container{display:flex;flex-direction:column;align-items:center;padding:2rem} |
2 changes: 1 addition & 1 deletion
2
backend/web/assets/AIPhotoHome-D43da-ga.js → backend/web/assets/AIPhotoHome-evzXqZV8.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.