Cropping is already included in Kirby and isnât really the problem here - But I get where youâre coming from my friend, and like you I like to write code just as much as i love to remove it. So with that out of the way.
Responsive images
The single most important thing you should care about today on the modern web (seriously -if you care about the web and users using it, at all! )
Just set dem 2x-Descriptors and sell it
Well, not really, I actually see devs either not really getting or testing this stuff, creating anti-patterns by only accounting for resolution and only using the (currently wider supported) x-descriptor, leading to even worse performance issues for users on mobile.
But full support for the w-descriptor is expected to land in Safari 9 on iOS and OS X (maybe as soon as in the beginning of September), according to this tweet from the Responsive Images implementor for WebKit himself, Yoav Weiss:
The best way to explain the problem and why we might need to attach a Focal Point or Entropy to images through the panel -is to let Yoav Weiss explain the use cases for these native html features a bit better, here goes:
So today we have three Responsive Use Cases, natively tied to srcset, sizes and the picture element
- Fixed Dimension Case
- Variable Dimension Case
- Art-Direction Case
But weâre currently only accounting for the Fixed and Variable Dimension Case in here, unless youâll degrade the use of the picture element and some parts of srcset and sizes to designers and devs, which I donât think was the entire point if youâre having a panel which entire and only point is to make all this stuff easy for those who isnât.
But a Focal Point could give back the power of code to the dev and whatâs important about the picture, back to the user.
Introducing: The new complex javascript âPoke Image To Select Point of Interrest Nav Thingy 3000 (Poke twice for rounded corners and frames)â.
Not necessary, although it could include an exciting mathematical problem or three for @bastianallgeier and team, and make Kirby the magical modern and minimalistic CMS of choice -setting the Image Entropy could probably be done with some kind of AI behind the scenes like they do on The Grid maybe with the ability to overwrite it in the backend somehow (as long as it works on mobile) and used as a simple resizeAndCrop($width, $height);
Although i really wouldnât mind kirby shipping with it, it could of cause also be a subject for a seriously great kirby plugin, to solve this native html problem for regular users using the panel, of cause Here are some great starting points
- Automatic Point of Interest Detection in PHP: https://github.com/stojg/crop
- Manually set Focal Point: https://github.com/jonom/silverstripe-focuspoint
Just because itâs new, doesnât mean it isnât important and already solved -more often, the complete opposite.