Not compressing images uploaded through REST API

Hi, I was working on this issue (Created image resource via API is scaled / reduced · Issue #4655 · laurent22/joplin · GitHub). As @laurent suggested we can disable compressing of images uploaded through APIs.

But also, as the same API is used by Plugins. There maybe a use case when a plugin wants to compress large images. So, should I also add a config option in the POST resources endpoint something like compress_images that if set to true will compress large images and it will be false by default?

What do you all think?