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

--size makes Chafa ignore explicitely declared --scale #115

Closed
SuperDuperDeou opened this issue Nov 21, 2022 · 2 comments
Closed

--size makes Chafa ignore explicitely declared --scale #115

SuperDuperDeou opened this issue Nov 21, 2022 · 2 comments
Labels
feature New feature or request
Milestone

Comments

@SuperDuperDeou
Copy link

SuperDuperDeou commented Nov 21, 2022

What I'm trying to do is to view an image that's tall and thin, I want to render it with no height limits but also to not upscale to fit the terminal's width (but still downscale if necessary, keeping the aspect ratio).

According to the man pages, I have the impression that setting --size "$COLUMNS" --scale 1 I should achieve just that, but it just ingores --scale and upscales the image to the full width of the terminal.

Chafa is version 1.12.4

@hpjansson
Copy link
Owner

hpjansson commented Nov 22, 2022

You're right that this is confusing (and currently impossible to do). --size is supposed to be a simple way to force the image size, so it always wins. --size "$COLUMNS" is saying "make the image exactly $COLUMNS cols wide and as tall as it needs to be to maintain the aspect ratio".

We need to add a parameter (called either --term-size or --frame-size) to set "soft" maximum image dimensions. See #84 (comment).

You can sort of fake this by calling stty cols $COLUMNS rows 9999 first, but that's obviously not ideal :-)

@hpjansson hpjansson added this to the 1.14 milestone May 1, 2023
@hpjansson hpjansson added the feature New feature or request label Jul 14, 2023
@hpjansson
Copy link
Owner

Fixed by 9a27c89 (I ended up calling it --view-size, so --view-size "$COLUMNS" --scale 1 should work for your use case.

Tangentially there's also a new option --fit-width introduced by ba14f04 that allows for ~infinite height (but as the name implies, scales to fit the width).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants