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

What are minimal image dimensions allowed for find_trim? #1392

Closed
Nakilon opened this issue Aug 8, 2019 · 2 comments
Closed

What are minimal image dimensions allowed for find_trim? #1392

Nakilon opened this issue Aug 8, 2019 · 2 comments
Labels

Comments

@Nakilon
Copy link

Nakilon commented Aug 8, 2019

# vips getpoint /tmp/t.v 0 0
123 123 123 
# vips find_trim /tmp/t.v --threshold 0 --background "123 123 123"
rank: window too large

# vipsheader -f width /tmp/t.v
2
# vipsheader -f height /tmp/t.v
17
# vips pngsave /tmp/t.v /tmp/temp.png
# xxd /tmp/temp.png 
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452  .PNG........IHDR
00000010: 0000 0002 0000 0011 0802 0000 0078 96ea  .............x..
00000020: 4600 0000 0970 4859 7300 000b 1200 000b  F....pHYs.......
00000030: 1201 d2dd 7efc 0000 0049 4944 4154 0899  ....~....IIDAT..
00000040: 75cb a10d 4021 0c00 d1eb a73b 20d1 9d91  u...@!.....; ...
00000050: d9e8 0c75 354c 8201 4382 faea 9297 9cf4  ...u5L..C.......
00000060: de01 5d6b 011f 00c8 1803 90bd f7c3 9bd2  ..]k............
00000070: 5a8b 08cd cc87 6a66 7f83 ba3b 506a ad73  Z.....jf...;Pj.s
00000080: ce8b 07f7 2e17 99fe 5162 c300 0000 0049  ........Qb.....I
00000090: 454e 44ae 4260 82                        END.B`.

# vips -v
vips-8.7.2-Wed Dec  5 17:37:43 UTC 2018
@jcupitt
Copy link
Member

jcupitt commented Aug 8, 2019

Oh, interesting, I've never tried it on really small images.

It does a median filter, so 3x3 I think.

john@yingna ~/pics $ vips black x.v 3 3
john@yingna ~/pics $ vips find_trim x.v
0
0
3
3
john@yingna ~/pics $ vips black x.v 2 2
john@yingna ~/pics $ vips find_trim x.v
rank: window too large

@Nakilon
Copy link
Author

Nakilon commented Aug 8, 2019

Oh, thanks. Probably it needs to be mentioned in docs or better have a more clear error message.

@Nakilon Nakilon closed this as completed Aug 8, 2019
jcupitt added a commit that referenced this issue Aug 8, 2019
lovell added a commit to lovell/sharp that referenced this issue Aug 13, 2019
webgurucan added a commit to webgurucan/node-image-handler that referenced this issue Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants