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

Add image size detection #103

Open
Nodachi216 opened this issue Aug 10, 2022 · 1 comment
Open

Add image size detection #103

Nodachi216 opened this issue Aug 10, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Nodachi216
Copy link

Right now I use a different bot to enforce a minimum image size but it has no flexibility. I'd like to be able to have a minimum image size most of the time but be able to ignore (or have a different minimum) based on post title.

@FoxxMD
Copy link
Owner

FoxxMD commented Aug 10, 2022

Great idea! And this should be pretty easy to add.

Thinking out loud:

  • Implement itemIs as a first-class rule (like AuthorRule) so it can be used with and/or conditions in rules block
  • Add simple contentType SubmissionState criteria for filtering based on content type IE image, text (self text)...this can already be done for reddit-hosted content using is_self and isRedditMediaDomain but not supported for external links
    • maybe some additional parsing to determine Content-Type header of external links and simplify for contentType? Or check if reddit data on submission already returns this (previews?)
  • Use sharp to determine image dimensions only if...
    • Sharp dependency is present (fail if not present)
    • If metadata properties (TBD) exist on SubmissionState (don't download image if metadata properties are not present)
  • Review what metadata is available from sharp to see if any other properties would be useful for filtering by (bit depth? image space?)

@FoxxMD FoxxMD added the enhancement New feature or request label Aug 10, 2022
@FoxxMD FoxxMD mentioned this issue Oct 17, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants