Skip to content

Commit

Permalink
documentation, performance, usage
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitmcu committed Jan 8, 2024
1 parent b65f6df commit 9843201
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gcode-preview
*.o
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,34 @@ Building and installing the C version
1. clone this repository locally on your machine
2. run `make clean && sudo make install` from within the repository folder

Performance
-----------
Quick benchmark of `gcode-preview` vs `gcode-preview-bash` extracting a 800x600 png image from a gcode file:

`gcode-preview-bash`:
```
real 0m0.014s
user 0m0.016s
sys 0m0.004s
```

`gcode-preview`:
```
real 0m0.002s
user 0m0.001s
sys 0m0.000s
```

Example usage
-------------

`gcode-preview -i benchy.gcode -o thumb.png`

`gcode-preview-bash benchy.gcode thumb.png`

Ranger / lf integration
-----------------------

With image previews enabled in [ranger](https://github.com/ranger/ranger/wiki/Image-Previews) or [lf](https://github.com/slavistan/howto-lf-image-previews), it is possible to extend the functionality to get previews for .gcode files, here is an example with lf:

![preview](/assets/lf.png)
Binary file added assets/lf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9843201

Please sign in to comment.