fabianmichael/kirby-imagekit

ImageSet + ImageKit

daybugging opened this issue · 5 comments

Hey there,
while ImageSet makes all them nice sizes, how would I optimize their quality with ImageKit? They don't seem to play along real nice .. what am I missing?

Cheers!

I don’t get you point why both plugins don’t "play along real nice" …

ImageSet needs/produces a lot of different image sizes, if you want to serve an optimal size to any client, like any other approach for esponsive images as well. Unfortunately, image processing with PHP is often not very performant, especially on cheap shared hosting plans. ImageKit serves thumbnails in an asynchronuous matter to circumvent this problem. You can activate several CLI tools in ImageKit which will automatically optimize your thumbnail files as they are created. The ImageKit readme describes how to use these optimization tools (you have to install these on your server, as they’re not just PHP code, but command-line applications).

Could I help you with my answer or did I miss you point?

made it clear, thanks!

// Edit:
After thinking about it, is there a way to apply compression on images when using ImageSet (other than with ImageKit)?

@daybugging You are free to write your own custom driver for applying compression tools, though this might result in some work and research. Just have a look at Kirby’s docs, there you can find out how to write a thumbnail driver. Another way would be to write a custom driver (or look for a plugin) that uses a third-party compression service like TinyPNG or EWWW. There are a lot of different options – in the end ImageSet just uses Kirby’s internal thumb driver for most of its image processing requirements. You can also override Kirby’s thumb API completely with a custom component (see extension registry), if you want to.

Haha thanks, I'll stay with ImageKit then!
Bit off-topic, but does the binary option require relative or absolute paths? Maybe give a quick example and then close this topic.

Thank you so much for this great piece of software.

// Edit:
I just downloaded mozjpeg .deb binary from this page and extracted cjpeg from it - will keep you posted how that works.

Bit off-topic, but does the binary option require relative or absolute paths?

What exactly do you mean by that?