Resize image after upload or via batch process

0
Hi i have a Mendix app used via Android and iOS tablets. Images from `camera roll` are uploaded via drop zone. Everything work just fine, but I want to reduce the size of the images after they have succesfully been uploaded and committed in order to save disk storage. Is it possible to process images larger than a certain size either determined by megabyte or pixels to a defined max width or height (px). Images must be scaled down proportionally without ‘black’ borders. Looking forward to learn what you do ! Regards  Morten  
asked
3 answers
1

Hi Morten,

You could setup an after commit event on the entity or use a scheduled event to run a microflow that does this. To get the image size, you could use the "Size" attribute on the File Document entity, or use the community commons java action "getImageDimensions" (depending on what what your requirement is). To resize the image, you could play around with the "DuplicateImageDocument" java action. This has parameters for width and height in pixels. Additionally there is a module for image resizing in the app store but it was made in Mx 4, so not too sure if it will work in Mx 7.

Hope this helps!

answered
0

Hi

first of all thank you for the quick reply.

I only find the thumb width/height in DublicateImageDocument.

Guess that won’t change image size ?

M.

answered
0

Hi Morten,

Did you solve this? Got the same issue in our web app (not native of hybrid mobile). I want to reduce filesize after commit as well. Working in 8.18. 

If you found a solution I'm happy to learn.

Thank you!

 

answered