jarun/imgp

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

omidraha opened this issue · 6 comments

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 commented

-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?

Yes, of course 👍

jarun commented

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 commented

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 commented

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 commented

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