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

Update this please #57

Open
muziker opened this issue Feb 15, 2020 · 11 comments
Open

Update this please #57

muziker opened this issue Feb 15, 2020 · 11 comments

Comments

@muziker
Copy link

muziker commented Feb 15, 2020

Hi there, there are some changes in ffmpeg and so the interface call signatures have been changed. Update this please, so we can all enjoy the ascii goodness

@maxsatula
Copy link

Found a fix for this, located here https://github.com/hzeller/timg

@jart
Copy link
Owner

jart commented Dec 2, 2021

I don't know how to compile hiptext anymore. I can't maintain it anymore because the Linux APIs it depended on kept radically changing. So I rewrote hiptext instead as two new and much better projects.

Enjoy!

@jart
Copy link
Owner

jart commented Dec 2, 2021

Also if you want C code that does what hiptext does with the least amount of effort possible please see:

@maxsatula
Copy link

maxsatula commented Dec 2, 2021

I don't know how to compile hiptext anymore. I can't maintain it anymore because the Linux APIs it depended on kept radically changing.

I was actually able to compile and run hiptext, that took about an hour to figure out. All I had to do are couple replacements in src/movie.cc to address #36

  • PIX_FMT_RGB24 with AV_PIX_FMT_RGB24
  • avcodec_alloc_frame with av_frame_alloc

And borrowed an older Ragel version 6 from another machine to build pixel_parce.cc (mine had version 7 which had a known issue to throw ragel: input.c:517: input_undo_prepend_tree: Assertion `si->queue.head != 0 && ( si->queue.head->type == SB_TOKEN || si->queue.head->type == SB_IGNORE )' failed. error upon compilation attempt). That's for now, and I agree if they keep changing APIs (and they will eventually do) you'll get tired pretty soon by constantly accommodating the changes.

Anyways, I'm shopping for the best terminal image viewer, sorry about looking the other way, but you know, 256 colors are out of fashion nowadays, as there are terminals and image viewers which support True Color.

@jart
Copy link
Owner

jart commented Dec 2, 2021

If you send me a pull request with your changes that make it build, I'll merge them.

I believe the printimage.com program is the best. It uses 24-bit by default. You have to pass the -x flag if you want the retro appeal of 256 color.

@maxsatula
Copy link

As a matter of fact, I've found an existing #52. CI fails though, perhaps because of an older version of ffmpeg library.

@jart
Copy link
Owner

jart commented Dec 4, 2021

Merged

@wchargin
Copy link
Collaborator

wchargin commented Jul 9, 2022

FWIW, I was able to build hiptext on Linux Mint 20.3 (packages based
on Ubuntu 20.04 LTS). I hit a roadblock in that libfreetype-dev no
longer includes the freetype-config utility, and in a few minutes of
poking I couldn't find an obvious way to get it.

I hacked around it by patching configure.ac to remove the check:

diff --git a/configure.ac b/configure.ac
index d1c8217..0a4ece8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,9 +47,6 @@ AC_SUBST(LIBGFLAGS_CFLAGS)
 AC_SUBST(LIBGFLAGS_LIBS)
 
 AC_CHECK_PROGS(FREETYPE, freetype-config)
-if test -z "$FREETYPE"; then
-  AC_MSG_ERROR([error: libfreetype-dev is required])
-fi
 LIBFREETYPE_CFLAGS="`$FREETYPE --cflags`"
 LIBFREETYPE_LIBS="`$FREETYPE --libs`"
 AC_SUBST(LIBFREETYPE_CFLAGS)

…and then patching the generated Makefile to manually configure the
Freetype build flags:

--- Makefile.old	2022-07-08 17:46:31.999241774 -0700
+++ Makefile	2022-07-08 17:45:23.812035049 -0700
@@ -519,4 +519,4 @@
 LIBAVUTIL_LIBS = -lavutil
-LIBFREETYPE_CFLAGS = 
-LIBFREETYPE_LIBS = 
+LIBFREETYPE_CFLAGS = -I/usr/include/freetype2
+LIBFREETYPE_LIBS = -lfreetype
 LIBGFLAGS_CFLAGS = 

That said, I later remembered how to find printimage.com (I knew there
was a newer one but couldn't find it by searching @jart's repositories
for image :-) ), which I agree is better anyway, so I'm mostly posting
this "just in case" it helps someone later.

@jart
Copy link
Owner

jart commented Jul 9, 2022

Since you put in the work, if you send me a PR I'll hit merge.

@wchargin
Copy link
Collaborator

wchargin commented Jul 9, 2022

Sure; I cleaned up the patch a bit and sent #60.

@pepa65
Copy link

pepa65 commented Oct 31, 2023

The build instructions in the readme don't work, but just cloning the repo, running ./autogen.sh, ./configure and then make do work.

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

No branches or pull requests

5 participants