diff --git a/config/config.exs b/config/config.exs
index 02bfa3191..9f125f79e 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -66,10 +66,11 @@ config :mime, :types, %{
config :mobilizon, Mobilizon.Web.Upload,
uploader: Mobilizon.Web.Upload.Uploader.Local,
filters: [
- Mobilizon.Web.Upload.Filter.Dedupe,
Mobilizon.Web.Upload.Filter.AnalyzeMetadata,
Mobilizon.Web.Upload.Filter.Resize,
- Mobilizon.Web.Upload.Filter.Optimize
+ Mobilizon.Web.Upload.Filter.Optimize,
+ Mobilizon.Web.Upload.Filter.BlurHash,
+ Mobilizon.Web.Upload.Filter.Dedupe
],
allow_list_mime_types: ["image/gif", "image/jpeg", "image/png", "image/webp"],
link_name: true,
diff --git a/js/src/components/Event/EventBanner.vue b/js/src/components/Event/EventBanner.vue
index 1e82f0c38..f2d429ab2 100644
--- a/js/src/components/Event/EventBanner.vue
+++ b/js/src/components/Event/EventBanner.vue
@@ -5,6 +5,7 @@
diff --git a/js/src/components/Image/BlurhashImg.vue b/js/src/components/Image/BlurhashImg.vue
index 9181991a1..a4017a5fc 100644
--- a/js/src/components/Image/BlurhashImg.vue
+++ b/js/src/components/Image/BlurhashImg.vue
@@ -7,17 +7,21 @@ import { decode } from "blurhash";
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
@Component
-export default class extends Vue {
+export default class BlurhashImg extends Vue {
@Prop({ type: String, required: true }) hash!: string;
@Prop({ type: Number, default: 1 }) aspectRatio!: string;
@Ref("canvas") readonly canvas!: any;
mounted(): void {
- const pixels = decode(this.hash, 32, 32);
- const imageData = new ImageData(pixels, 32, 32);
- const context = this.canvas.getContext("2d");
- context.putImageData(imageData, 0, 0);
+ try {
+ const pixels = decode(this.hash, 32, 32);
+ const imageData = new ImageData(pixels, 32, 32);
+ const context = this.canvas.getContext("2d");
+ context.putImageData(imageData, 0, 0);
+ } catch (e) {
+ console.error(e);
+ }
}
}
diff --git a/js/src/components/Image/LazyImageWrapper.vue b/js/src/components/Image/LazyImageWrapper.vue
index af5b43493..1b3e1313a 100644
--- a/js/src/components/Image/LazyImageWrapper.vue
+++ b/js/src/components/Image/LazyImageWrapper.vue
@@ -9,6 +9,7 @@