AlfredoSequeida / venus

Venus aims to be a cross-platform tool to automatically change your desktop wallpaper to something random using images from Unsplash.
MIT License
25 stars 6 forks source link

Resolution Settings should filter images and not resize images #22

Open pfassina opened 2 years ago

pfassina commented 2 years ago

Downloaded images not always conform to the resolution specifications on the Venus config. What I noticed was that some of the wallpapers seemed to be a zoomed and cropped version of a larger wallpaper.

This example shows unsplash returning an image that doesn't fit the resolution filter. I have the Venus config file filtering for images with the following resolution: 2560×1600 However, unsplash returned an image with 3648×5472 resolution cropped to 2560×1600.

This is the link to the original image: https://unsplash.com/photos/iMM8WRNllBw However, this was the image downloaded by Venus: venus_l0u8t4cl

After reading unsplash's api, it looks like the w & h parameters are meant to dynamically change the image output, not filter images from your query. This behavior is somewhat intuitive, and it can lead to Venus downloading less than ideal wallpapers.

I'm considering a few approaches, but it looks like a potential solution would be to query unsplash's api for a list of photos, analyze the results, filter images based on the resolution, and pull a random photo from the results.