Autoscaling

2019-04-22 14:21

I woke up early this morning and wasn't totally exhausted. Woho. So I had breakfast and wrote a small applet for the CMS system again, this time doing automatic scaling and caching of images in the blog (although it could be used for any image in the system).

It must be wonderful to have a mathematical mind, I always struggle when trying to build an algorithm that does something math-y; in this case it was fitting a bounding box to the source image so it can be cropped and scaled proportionally into a given size, and I am still not sure I got it right... Ugh.

Now for a shower...

Addennum:

I hadn't got it right. Fixed now.

Staffan