Uploaded images are kept the same dimensions, but are much smaller file sizes

My original images are 2400x1600px and around 2.6 MB.

I’ve upload the images, to the Contents folder. They remain 2400x1600px, but are now around 900 KB.

I’ve set up my Blueprint to reduce the dimensions of images over 2400px:

title: Default Page

columns:
	main:
		width: 2/3
		fields:
			hero_image:
				label: Hero image
				type: files
				uploads: image-upload
title: Image upload template
create:
  width: 2400
  height: 2400

It seems that Kirby is resizing the 2400px images, to 2400px AND compressing them?

I’ve altered my code by 1px to avoid any resizing, but the uploaded images, in the Contents folder, are still smaller file sizes. This indicates that images are being compressed?

title: Image upload template
create:
  width: 2401
  height: 2401

I guess if it goes through the thumbs handler, that would be the case, but unable to properly debug what’s happening.

Yeah, it seems that even though images are not being resized on upload, they are still being looked at by the thumbs handler and compressed.

Is there a way for me to control the compression on upload? To turn it off, or set quality to 100. And then set the compression following the Responsive Images cookbook Responsive images | Kirby CMS. I want to avoid two lots of compression.

Here’s one of my images

I’ve just uploaded a 500px, 137KB image. I would assume, as this does not get resized on upload that it would remain 137KB, but in the Contents folder it is now 46KB.

I think this proves that the thumbs handler is compressing images that do not need to be resized.

I presume it is also compressing images that are resized.

This doesn’t seem great, because responsive images will get two rounds of compression applied to them?

Is this a bug?

I don’t know, ideally, Kirby would leave images that don’t need to be resized in their original state. Now, you could argue that the images that do get resized will get two rounds of treatment as well when you use thumbs in the frontend, so at least they are treated equal ;).

But I would have expected that they are left alone.

@bastianallgeier @distantnative Intended or not?

Can reproduce it. I don’t think it’s a big problem, but I created an issue as it’s for sure not ideal performance-wise (maybe sometimes quality-wise): Files: don't run thumb processing if image smaller than the `create` dimensions · Issue #6437 · getkirby/kirby · GitHub