Imagine resize/crop quality parameter has no effect

I have a problem in which when I resize/crop a image the quality parameter seems to have no effect.

A Image that is generated like:

<img src="<? echo $data->image()->toFile()->resize(670,0, 1)->url() ?>" />

Will looks the same as

<img src="<? echo $data->image()->toFile()->resize(670,0, 100)->url() ?>" />

And even the size of the output file will be the same, but the resizing itself works fine.
Could this be a serverside problem? Or am I doing something wrong.

A height of 0 probably doesn’t make sense.

Well that is true, but i just want to keep the aspect ratio of the image.
But even when using “null” instead of 0, the problem still persists

Ok, so the files are actually generated in the media folder with the right size when inspected?

I’m just testing this in a Starterkit and for me, it works fine (even with height 0)

Which image library are you using, GD or IM?

Which Kirby version, GD/IM version, PHP version?

It is actually rather irrelevant what you put in for the height value, because resize() doesn’t crop, it always keeps the aspect ratio.

Kirby is 3.5.1
PHP is 7.3.20
GD is 2.1.0
IM is 3.4.4

Detailed view:

But which one do you actually use? Or have you tested both?

Are you working in your local dev environment (which one) or remote server?

On a side note:

You should test if toFile() really returns an image before you call resize/any other method.

I am working on my remote server - Have tested both gd and im by changing the thumbs drivers thumbs | Kirby now, both have the same problem.
And the toFile does return the image as expected.

What I meant is that in such cases you should always use an if statement because you cannot rely on the image being there in all eternity (but that was just a side note as general coding advice, not related to your current issue).

Could you also test with an up-to-date Starterkit please?

Well that is interesting, with a fresh starterkit it does seem to be working just fine.
I guess I have to do some digging why this is happening…

A plugin, maybe? Other custom code?

Well… I had a oversight, the starterkit only works with jpg’s, png’s seem to be the problem.
Those do not work on in my starterkit aswell as in my production page.

Jpg’s work fine.

After looking around this seems to be a problem that has been noticed by other users in the forum before, is there a way to control quality on resize/crop on pngs?