openstate / open-cultuur-data

The back- and front-end code that powers the Open Cultuur Data API
http://opencultuurdata.nl/
28 stars 18 forks source link

Filter on portraits, landscapes (and perhaps even relative squares) #118

Open ajslaghu opened 9 years ago

ajslaghu commented 9 years ago

Usecase: I am looking only for landscapes when it comes to wallpapers on my desktop.

But looking for Shower curtains I would filter on portraits.

Assuming images consist of X and Y;
X < Y (absolute portrait) Y > X (absolute landscape) Y == X (Absolute square)

X < aY (a=0-0.999 relative portrait) Y < aX (a=0-0.999 relative landscape) X >= aY && Y >= aX (relative square)

what would be factor a? lets assume aspect ratioś should also be provided (as filter) , I would assume aspect ratios wont exceed 1 digit (34/179th, anyone?). meaning 9/10 is not correct, but 8/9 would be. the most sqaared aspect ratio then would be 5/9 or 4/9 the result is a difference of 5.55% from 50%. I think this is a nice margin for errors.

breyten commented 9 years ago

Implementation is (partiallly) done in #104 (orientation), having aspect ratios should be added.