Pridan fotoeditor
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user