Scaling images - full view - less quality

Enonic version: 7.4.0
OS: Windows 10

Hi,
is there any way how can i scale images? Scaling images i mean getting same picture (without cutting of sides - not using block) just in less quality.
I am currently in need of downloading picture for preview (small window around 250px), where i need the full view of the picture, but downloading e.g. 5000x4000px pic seems unnecessary and slow, since theses pics have 5MB and more. (I need these pic in maximum quality later and i do not want to save 2 same images in quality difference for preview and full view).

Thx,
Martin

https://developer.enonic.com/docs/xp/stable/runtime/engines/site-engine/image-service

1 Like

Hi,

i already went through image service documentation. But there does not seem to be any solution solving the problem i have or i overlooked it. Does that mean that there is not any way to reduce the image quality. Some sort of enonic img compressor?

Thx,
Martin

Ah, I got confused about you mentioning that you wanted to scale the image!

Actually, there is a quality parameter which appears to be undocumented…

Anyway, I would not recommend using it Im most cases. It only applies to jpeg, and defaults to 85% which typically gives to optimal quality vs size ratio.

1 Like

I may have described the issue i have poorly. So just to make it clear. I’ve got pics saved in enonic DB, but they are big (around 5000x4000px), which is useful later on web when i am showing this pic in full view. But on the dashboard part of the web i am showing this pics on 250x250px area, so just get the img in smaller size would help.
Plainly: I need to get from pic saved in enonic the same one resized (2-times/3-times smaller size of the original). I also need the picture to have the same sides ratio, so it wont get deformed. And i cant use scale: block from enonic, because i do not wanna crop the img -> need it to be readable, need to keep the whole img.

Thx again,
Martin

Simply choose between the other scaling methods that will not crop your aspect ratio, i.e. max, width or height:

https://developer.enonic.com/docs/xp/stable/runtime/engines/site-engine/image-service#scaling_methods

1 Like