diff --git a/contao/templates/frontend/event_edit.html.twig b/contao/templates/frontend/event_edit.html.twig
index 16d6351..09623ae 100644
--- a/contao/templates/frontend/event_edit.html.twig
+++ b/contao/templates/frontend/event_edit.html.twig
@@ -10,11 +10,19 @@
+
+
+
{{ form_start(form, { action: app.request.uri, attr: { 'aria-live': 'polite' } }) }}
@@ -212,6 +220,12 @@
if (typeof window.FilePondPluginImagePreview !== 'undefined') {
window.FilePond.registerPlugin(window.FilePondPluginImagePreview);
}
+ if (typeof window.FilePondPluginImageResize !== 'undefined') {
+ window.FilePond.registerPlugin(window.FilePondPluginImageResize);
+ }
+ if (typeof window.FilePondPluginImageTransform !== 'undefined') {
+ window.FilePond.registerPlugin(window.FilePondPluginImageTransform);
+ }
const filePondOptions = {
instantUpload: false,
@@ -220,6 +234,30 @@
allowReplace: true,
credits: false,
acceptedFileTypes: ['image/*'],
+ allowImageResize: true,
+ imageResizeUpscale: false,
+ allowImageTransform: true,
+ onaddfile: function (error, fileItem) {
+ if (error || !fileItem || typeof fileItem.setMetadata !== 'function') {
+ return;
+ }
+
+ const fileType = fileItem.fileType || (fileItem.file && fileItem.file.type) || '';
+
+ if (fileType === 'image/svg+xml') {
+ fileItem.setMetadata('resize', null);
+ return;
+ }
+
+ fileItem.setMetadata('resize', {
+ mode: 'contain',
+ upscale: false,
+ size: {
+ width: 2000,
+ height: 2000
+ }
+ });
+ },
labelIdle: 'Bild hierher ziehen oder durchsuchen'
};
diff --git a/contao/templates/frontend/organization_edit.html.twig b/contao/templates/frontend/organization_edit.html.twig
index df29c5b..c2a09ce 100644
--- a/contao/templates/frontend/organization_edit.html.twig
+++ b/contao/templates/frontend/organization_edit.html.twig
@@ -8,9 +8,17 @@
+
+
+
{{ form_start(form, { attr: { 'aria-live': 'polite' } }) }}
@@ -73,6 +81,12 @@
if (typeof window.FilePondPluginImagePreview !== 'undefined') {
window.FilePond.registerPlugin(window.FilePondPluginImagePreview);
}
+ if (typeof window.FilePondPluginImageResize !== 'undefined') {
+ window.FilePond.registerPlugin(window.FilePondPluginImageResize);
+ }
+ if (typeof window.FilePondPluginImageTransform !== 'undefined') {
+ window.FilePond.registerPlugin(window.FilePondPluginImageTransform);
+ }
const filePondOptions = {
instantUpload: false,
@@ -81,6 +95,30 @@
allowReplace: true,
credits: false,
acceptedFileTypes: ['image/*'],
+ allowImageResize: true,
+ imageResizeUpscale: false,
+ allowImageTransform: true,
+ onaddfile: function (error, fileItem) {
+ if (error || !fileItem || typeof fileItem.setMetadata !== 'function') {
+ return;
+ }
+
+ const fileType = fileItem.fileType || (fileItem.file && fileItem.file.type) || '';
+
+ if (fileType === 'image/svg+xml') {
+ fileItem.setMetadata('resize', null);
+ return;
+ }
+
+ fileItem.setMetadata('resize', {
+ mode: 'contain',
+ upscale: false,
+ size: {
+ width: 800,
+ height: 800
+ }
+ });
+ },
labelIdle: 'Logo hierher ziehen oder durchsuchen'
};