Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-sharp] filter images by aspect ratio #3862

Closed
davidbarratt opened this issue Feb 5, 2018 · 4 comments
Closed

[gatsby-plugin-sharp] filter images by aspect ratio #3862

davidbarratt opened this issue Feb 5, 2018 · 4 comments

Comments

@davidbarratt
Copy link

I would really like to filter images in allImageSharp by the aspect ratio, but I can't find a way to do this.

The reason why is that I only want to include images that are horizontal (not vertical).

Alternatively, is there a way to filter that the width is greater than the height?

@nsimonson
Copy link
Contributor

The gatsby graphql filter for Floats and Ints only allows for equal eq or not equal ne. Although I imagine this could be (should be?) extended to the other relational operators.

The best way for now might be to filter the result of the query on the client side.

@KyleAMathews
Copy link
Contributor

Yeah, we need to add "greater than" and "less than" filtering support. The library we use under the hood to run queries supports it, someone just needs to add some tests and enable the support! https://github.com/crcn/sift.js/

@KyleAMathews
Copy link
Contributor

@pieh mentioned he might be working on this soon #3688 (comment)

@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants