Pridan fotoeditor

This commit is contained in:
Michal Kváček
2023-10-27 22:30:47 +02:00
parent 4c8952117b
commit 100e1fa33b
18 changed files with 502 additions and 23 deletions
+18
View File
@@ -0,0 +1,18 @@
import {computed} from "vue";
import {croppedArea} from "src/composables/photos/editor/crop";
export const getPreviewUrl = (photoId, adjustments) => {
const url = new URL(`${process.env.API_URL}/photo/editor-preview/${photoId}`);
url.search = new URLSearchParams(adjustments).toString();
return url.toString();
};
export const croppedAreaForPreview = computed(() => {
if (!croppedArea.value) return {};
return {
crop_left: croppedArea.value.left || 0,
crop_top: croppedArea.value.top || 0,
crop_width: croppedArea.value.width || 1,
crop_height: croppedArea.value.height || 1
}
});