mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
21 lines
606 B
TypeScript
21 lines
606 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { PythonRPC } from "@main/services/python-rpc";
|
|
|
|
const processProfileImageEvent = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
path: string
|
|
) => {
|
|
return processProfileImage(path, "webp");
|
|
};
|
|
|
|
export const processProfileImage = async (path: string, extension?: string) => {
|
|
return PythonRPC.rpc
|
|
.post<{
|
|
imagePath: string;
|
|
mimeType: string;
|
|
}>("/profile-image", { image_path: path, target_extension: extension })
|
|
.then((response) => response.data);
|
|
};
|
|
|
|
registerEvent("processProfileImage", processProfileImageEvent);
|