Yes, I like your version which is much simpler than shortcodes.
There are quite a lot of transformations that could be done with images. A long list can be found in the Cloudinary Image Transformation docs.
However, I think the basics like you describe would suffice for most use cases. There are only two things for me to add:
- There should be a crop switch. Otherwise, if you say
map.200x400.jpgit’s not clear if it needs to be resized to 200x400 or cropped to that size. - There should be a way to say:
height=200and I don’t care about the width.
I don’t know about the syntax, just some ideas:
Syntax 1
- Size:
image.s200.jpg(200 is longest dimension) - Width:
image.w200.jpg - Height:
image.h300.jpg - Width and Height:
image.w200-h300.jpg - Size with Cropping:
image.s200-c.jpg - Width and Height with Cropping:
image.w200-h300-c.jpg
(this is somewhat similar to what Google App Engine implemented but did not document. I stumbled upon it by accident and added it in this issue comment. You can play around with the example link to bananas…)
Syntax 2
Similar as above but with query parameters:
image.jpg?w=200&h=300&c=true
Syntax 3
Yet another option:
image.jpg?w200-h300-c