use number for aspect ratio
This commit is contained in:
parent
6425afbfce
commit
1d50beb552
3 changed files with 5 additions and 5 deletions
|
@ -22,7 +22,7 @@
|
|||
ref="cropper"
|
||||
:img="imgUrl"
|
||||
:options="{
|
||||
aspectRatio: aspectRatio ? aspectRatio[0] / aspectRatio[1] : null,
|
||||
aspectRatio: aspectRatio ?? null,
|
||||
viewMode: 1,
|
||||
}"
|
||||
></VuePictureCropper>
|
||||
|
@ -52,7 +52,7 @@ const emit = defineEmits<{
|
|||
|
||||
const props = defineProps<{
|
||||
file: firefish.entities.DriveFile;
|
||||
aspectRatio?: Array<number>;
|
||||
aspectRatio?: number;
|
||||
}>();
|
||||
|
||||
const imgUrl = `${url}/proxy/image.webp?${query({
|
||||
|
|
|
@ -747,7 +747,7 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
|
|||
export async function cropImage(
|
||||
image: firefish.entities.DriveFile,
|
||||
options?: {
|
||||
aspectRatio?: Array<number>;
|
||||
aspectRatio?: number;
|
||||
},
|
||||
): Promise<firefish.entities.DriveFile> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -257,7 +257,7 @@ function changeAvatar(ev) {
|
|||
|
||||
if (!canceled) {
|
||||
originalOrCropped = await os.cropImage(file, {
|
||||
aspectRatio: [1, 1],
|
||||
aspectRatio: 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ function changeBanner(ev) {
|
|||
|
||||
if (!canceled) {
|
||||
originalOrCropped = await os.cropImage(file, {
|
||||
aspectRatio: [16, 9],
|
||||
aspectRatio: 16 / 9,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue