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

How to resize all image but ignore images with leass than 200 dimentionals #39

Closed
omidraha opened this issue Nov 24, 2020 · 6 comments
Closed

Comments

@omidraha
Copy link

How to resize all image but ignore image with less than 200 dimensional?

I try:

imgp -wrpecx 50 -k 300 images

But it still convert an image from 194x260 to 96x130

I want to skip some images like this.

@jarun
Copy link
Owner

jarun commented Nov 24, 2020

-k is to preserve images matching hres or vres. You are specifying x using percentage.

Currently you can skip by size by not by a specific hres/vres.

I think we can extend -k to take an optional param which will be a resolution, and when matching hres or vres will skip the image. Can you please raise a PR?

@omidraha
Copy link
Author

Yes, of course 👍

@jarun
Copy link
Owner

jarun commented Nov 24, 2020

So let's do it this way:

  • no params: skip matching hres/vres in -x
  • single res: skip res matching hres/vres
  • hresxvres: skip hres mathcing hres and vres matching vres

I think the best way to do it would be to set a khres and kvres (k for keep) when we get -k and then match hres against khres and vres against kvres.

@jarun jarun changed the title How to reazie all image but ignore images with leass than 200 dimentionals How to resize all image but ignore images with leass than 200 dimentionals Nov 25, 2020
@jarun
Copy link
Owner

jarun commented Nov 26, 2020

Any image with lesser H/V resolution than specified in --res is skipped already. Also, if you still want to resize those there are options like --force and --enlarge.

@jarun
Copy link
Owner

jarun commented Nov 26, 2020

The catch I see is if you want to specify a resolution larger than your target resolution. Maybe a param other than -k would be a simpler implementation.

@jarun jarun closed this as completed in e323897 Nov 26, 2020
@jarun
Copy link
Owner

jarun commented Nov 26, 2020

Please check out option -M on master and see if it works fine.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants