CalcBuilder Forum

How do I stop images being resized and downgraded when uploaded via Calcbuilder?

User TheFencepedia 2024-12-16 23:42:17

Hi there,

I paid someone to build a drawing module for me that produces an image in PNG format.

This image is then uploaded via the image upload field on Calcbuilder, and using some custom PHP code he wrote me, is inserted into the exit layout of a Calcbuilder calculator.

However, as you can see in this video: https://drive.google.com/file/d/1mBQCVWfbWEpM6Xj50P3CRNufMJbkAUjv/view?usp=drive_link

Since I can see that the images in the storage folder after upload are NOT the same quality as the images I've uploaded, the only logical explanation is that something in the Calcbuilder system is downgrading the quality, and I need to fix that ASAP.

Thanks.

User TheFencepedia 2024-12-17 03:39:31

Hi again,

I've been trying to figure this out, and it looks like the image is definitely downgraded when it's uploaded via the calculator.

I've attached two screenshots. One is of the file I downloaded from the drawing tool, and as you can see, it's over 1000px wide.

The other is of the file in my media folder after being uploaded via the calculator, and it's 320px wide.

I need to stop that from happening. How do I fix this?

User TheFencepedia 2024-12-17 03:40:12

Sorry. Could only upload one file.

Moonsoft support 2024-12-17 10:01:53

Hi,
the calcbuilder is not resizing the images when uploaded, mostly because this upload field can be used to upload any kind of file, not only images, so it uploads any extension without changes. It does allow to introduce 'validations' on the size or the file extensions, but in that case you would receive an error and the upload wouldn't finish. The method used to upload is the default Joomla one provided by the class 'File' , so you may have at your Joomla configuration one setting to resize automatically the images when you upload them. A plugin is also able to do this, for ex the core plugin 'Media Action - Resize' can do automatic resize on upload if you have enabled it, we suggest to check if it also happens when you upload using the media option to confirm.

Hope this helps, regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2024-12-17 11:40:06

Thanks. It works fine with Webp files for some reason. Just not PNGs.

User TheFencepedia 2024-12-17 11:53:47

Hi again. I changed the number of files that can be uploaded on the Preferences tab, and now when I try to upload a file, I get an error. It was working fine before. Any idea what's causing that?

User TheFencepedia 2024-12-17 12:22:49

Hi again,

I rolled back to an earlier backup and solved the error issue.

However, when I upload files via the media menu or in articles, it does NOT automatically resize the images. I also checked the plugin you mentioned above, and there are no resize parameters set, so it's not that. I don't specifically have any other plugins for resizing images either, and this ONLY happening when I upload a PNG via the upload field on Calcbuilder.

Moonsoft support 2024-12-17 15:20:47

Hi,
ok, then definetively its not made at server side by the Joomla File class, but we have found a js issue that can be causing that at the front-end. Can you please upgrade to latest version 5.5.4 and try again to confirm if you can see any difference?

Thanks, regards
Silvia Martín
Moonsoft Team

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!