diff --git a/dashboard/src/components/ImagePicker.vue b/dashboard/src/components/ImagePicker.vue
index ec0a66108..9b7ac4d1c 100644
--- a/dashboard/src/components/ImagePicker.vue
+++ b/dashboard/src/components/ImagePicker.vue
@@ -10,8 +10,8 @@ const props = defineProps({
mode: { type: String, default: 'editable', required: true },
src: { type: String, required: true },
fallbackSrc: { type: String, required: true },
- size: { type: String, required: true },
- maxSize: { type: String, required: false },
+ size: { type: Number, required: false, default: 512 },
+ maxSize: { type: Number, required: false, default: 0 },
displayHeight: { type: String, required: false },
displayWidth: { type: String, required: false },
disabled: { type: Boolean, required: false },
@@ -109,22 +109,19 @@ function onChanged(event) {
fr.onload = function () {
const image = new Image();
image.onload = function () {
- const size = props.size ? parseInt(props.size) : 512;
- const maxSize = props.maxSize ? parseInt(props.maxSize) : 0;
-
const canvas = document.createElement('canvas');
- if (maxSize) {
- if (image.naturalWidth > maxSize) {
- canvas.width = maxSize;
- canvas.height = (image.naturalHeight / image.naturalWidth) * maxSize;
+ if (props.maxSize) {
+ if (image.naturalWidth > props.maxSize) {
+ canvas.width = props.maxSize;
+ canvas.height = (image.naturalHeight / image.naturalWidth) * props.maxSize;
} else {
canvas.width = image.naturalWidth;
canvas.height = image.naturalHeight;
}
} else {
- canvas.width = size;
- canvas.height = size;
+ canvas.width = props.size;
+ canvas.height = props.size;
}
const imageDimensionRatio = image.width / image.height;
diff --git a/dashboard/src/components/app/Display.vue b/dashboard/src/components/app/Display.vue
index d6aa5c112..bd240c68a 100644
--- a/dashboard/src/components/app/Display.vue
+++ b/dashboard/src/components/app/Display.vue
@@ -89,7 +89,7 @@ onMounted(() => {
-
+