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

Kitty inline image & base64 encoding fixes #177

Merged
merged 1 commit into from
Apr 5, 2021
Merged

Conversation

bptato
Copy link
Contributor

@bptato bptato commented Apr 4, 2021

  • base64_encode used to return a char buffer, I replaced this with a Str struct. This also means that Strcat_char does pointless bounds checking in this function which could be done once... no noticeable performance impact for me but if deemed necessary we could also write directly to the char pointer. Or use a gc_malloc'ed buffer as before, then call Strnew_charp.
  • I fixed an oversight of mine where base64 padding could be applied incorrectly.
  • Finally I changed the convert call to specify that ImageMagick should extract the first frame only from gifs. It otherwise extracted all frames for animations, which made w3m look for the wrong path.

@tats tats merged commit 068e2c2 into tats:master Apr 5, 2021
@tats
Copy link
Owner

tats commented Apr 5, 2021

base64 padding could be applied incorrectly.

Confirmed and merged. Thanks for your contribution.

Strcat_char does pointless bounds checking

I've defined Strcatc and Strnulterm (like Strcat_char, but with no checks),
and replaced with them in base64_encode().

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.

None yet

2 participants