- workout target file size
- read the database for image file locations
- with the now known target file size, and number of images, some thoughts
- how many rows of images?
- how many columns?
- any padding or use all the space avaialble?
- are the source images the same aspect ratio?
- if there are not enough images to fill out a row, should the row be truncated?
- anyway, resize the source posters and then use these to create a wallpaper…simple right!…
This project actually came up with a few mathematical issues, which was fun, such as calculating the width and height of a rectangle when you know only the area and aspect ratio:
If for example the target width was calculated to be 27 pixels, at an aspect ration of 3:2 this would give a height of 27/2 * 3 = 40.5. You can’t have 40.5 pixels.
So reduce the width and check again.
Although, on review I could rewrite this to a modulo operation.
Some sample confiurations which result in zero padding when used:
|Full width||Full height||Images||Sample wallpaper|
Anyway, I packaged this all up into an AWK script I could run from WSL.