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

fix: ImageMagick handling #74

Closed
wants to merge 3 commits into from
Closed

fix: ImageMagick handling #74

wants to merge 3 commits into from

Conversation

sammcj
Copy link

@sammcj sammcj commented Jun 7, 2024

@thomasmerz
Copy link

I tested it and this fixes #71 👍🏼

@esposm03
Copy link

esposm03 commented Jun 7, 2024

This doesn't work with ImageMagick v6

imagemagickv6

lsix Outdated
@@ -133,7 +133,7 @@ autodetect() {
# Attempt to set the number of colors to 256.
# This will work for xterm, but fail on a real vt340.
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;3;256S' >&2
[[ ${REPLY[1]} == "0" ]] && numcolors=${REPLY[2]}
[[ ${REPLY[1]} == "0" && ${REPLY[2]} -gt 0 ]] && numcolors=${REPLY[2]}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What terminal requires this change?

lsix Outdated
| convert - -colors $numcolors sixel:-
done
# Create and display montages one row at a time.
while [ $# -gt 0 ]; do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the purpose of changing the indentation?

lsix Outdated

# Note: The 'montage' command is not affected by this change, so it remains the same.
montage "${onerow[@]}" $imoptions gif:- \
| magick - -colors $numcolors sixel:- # Convert to magick here.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would fail on a system with ImageMagick 6 which does not have a Magick command.

#fontsize=16 # (or set the point size directly, if you prefer)

timeout=0.25 # How long to wait for terminal to respond
# to a control sequence (in seconds).
timeout=0.25 # How long to wait for terminal to respond
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why you would want to reindent comments in this way.

fi

# SIXEL SCROLLING (~DECSDM) is now presumed to be enabled.
# See https://github.com/hackerb9/lsix/issues/41 for details.

# TERMINAL COLOR AUTODETECTION.
# Find out how many color registers the terminal has
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain to me what you were thinking when you made this change? Multiple spaces helps separate the environment from the command. Why change it?

@hackerb9
Copy link
Owner

I appreciate the work you put in to make lsix better, but there are too many changes without explanation.

@hackerb9 hackerb9 closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installed a fresh lsix on macOS with homebrew, got a IMv7 warning
4 participants