Comments (5)
I want to keep the default behaviour to fit horizontally because it makes up for more pixels and we can always scroll. 0 to make it fit vertically sounds nice to me 👍
from catimg.
I see that the code does use an ioctl to get the columns! Could also return the lines.
I haven’t done much C but this could be a fun thing to write. I’m not available in the next weeks, so someone else feel free to take this!
from catimg.
I remember I didn't add it because there wasn't a consistent way of getting the height of the terminal, only the width.
I don't know if the situation has changed but I'm open to contributions if it has
from catimg.
Do you need the height in lines or pixels?
For lines, maybe some inspiration could be taken from Python. There is a function in the standard library that checks for the COLUMNS and LINES environment variables (ref http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html#tag_002_003 ), or calls an ioctl: python/cpython@bcf2b59#diff-a6f29e907cbb5fffd44d453bcd7b77d5R128
I supposes that calling stty size
in a sub-process would make the program too slow?
from catimg.
Writing terminal_lines is easy but the command-line interface is harder, especially in the interaction of -w and the new flag. Could you define behaviour that you would accept?
- Change code from width to height, keep default to fit terminal
- Keep -w flag, add another flag for height (with value 0 to ask to fit height), error if both are given
- Something else?
(Value 0 to mean “do your best” inspired by make -j 0 meaning “use all processors”)
from catimg.
Related Issues (20)
- heap buffer overflow in stbi__tga_load
- segfault in stbi__getn HOT 3
- heap-buffer-overflow in img_load_from_data HOT 1
- ASan global-buffer-overflow src/stb_image.h:1923 in stbi__extend_receive HOT 1
- I can't compile it HOT 1
- Incorrect colour output with zsh HOT 1
- width (-w) handling depending on resolution HOT 2
- preview in ssh HOT 2
- Script not working on macos catalina HOT 4
- catimg retired in Fedora repository HOT 8
- Please support GCC10 HOT 1
- watch -c doesn't work properly with catimg
- Segmentation fault caused by null pointer exception HOT 1
- Show one text and one image side by side HOT 4
- Exceeds maximum supported memory when processing gif with excessive w*h
- Exceeding the valid memory range while parsing the GIF file's background
- Modify image aspect ratio for different terminal fonts HOT 3
- piping catimg doesn't properly work HOT 2
- Images do not properly scale vertically HOT 2
- Corrupted GIF header causes null pointer dereference by failed allocation due to integer overflow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catimg.