Skip to content

Commit

Permalink
Merge pull request #7 from FynnFreyer/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
FynnFreyer authored Aug 28, 2022
2 parents 150acd1 + 969b553 commit 8c6f241
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Want to find that one meme with the funny punchline?
Looking for a picture of a PowerPoint presentation on a specific topic, that you took 5 years ago?
IMGrep might help.

It works like `grep`, but for images, and with a lot less features
... and it's also much slower ... and not suuuper accurate ;D
It works like `grep`, but for images, and with a lot less features ... and it's also much slower ... and not suuuper
accurate, especially for handwriting, or weird fonts ;D

IMGrep is built on the [Tesseract-OCR-Engine](https://github.com/tesseract-ocr/tesseract)
and uses [pytesseract](https://pypi.org/project/pytesseract/) for the bindings.
`imgrep` is built on top of [Tesseract-OCR](https://github.com/tesseract-ocr/tesseract) and uses
the [pytesseract](https://pypi.org/project/pytesseract/) bindings to interface with it.

# Install

You can install imgrep from [PyPI](pypi.org) with `pip`
You can install `imgrep` from [PyPI](https://pypi.org/project/imgrep/) with `pip`

pip install imgrep

Expand Down Expand Up @@ -52,5 +52,24 @@ And it is still much faster, than combing through my photos one by one, when I'm

- Having `-a` and `-b` flags to include N lines of output after, and before the match would be nice.
- Also coloring the output on smart terminals would be cool.
- That opens a whole can of worms with determining whether the terminal supports it or not.
- Or whether the user wants color (NOCOLOR, or TERM=dumb etc.?).
- That opens a whole can of worms with determining whether the terminal supports it or not.
- Or whether the user wants color (NOCOLOR, or TERM=dumb etc.?).
- Fuzzy search
- Preprocessing/Indexing (?)
- Pro:
- Done once it heavily improves performance for subsequent searches
- Con:
- I don't want to put garbage files into the users' filesystem.
This could be done, by having only one index file in XDG_CONFIG_HOME (or similar on other OS's),
that gets uninstalled with imgrep in the end.
- Conclusion:
- Probably worth it

# Alternatives

I noticed, that there is a similar project, even with the same name [imgrep](https://github.com/keeferrourke/imgrep).
I am in no way affiliated with that project, but it looks cool, and it might actually suit you better, because they
already allow for preprocessing and fuzzy search, both of which are not currently implemented in this project.

OTOH for a quick and dirty one off job the convenience of `python -m pip install imgrep; imgrep -rif pattern images` is
probably nice.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "imgrep"
version = "0.0.3"
version = "0.0.4"
authors = [
{ name="Fynn Freyer", email="[email protected]" },
]
Expand Down
3 changes: 3 additions & 0 deletions src/imgrep/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,6 @@ def main(argv=None):
print(line, end='\0' if null else '\n')

exit(0)

if __name__ == '__main__':
main()

0 comments on commit 8c6f241

Please sign in to comment.