jart / hiptext

Turn images into text better than caca/aalib
Apache License 2.0
763 stars 44 forks source link

Update this please #57

Open muziker opened 4 years ago

muziker commented 4 years ago

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 commented 2 years ago

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

jart commented 2 years ago

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 commented 2 years ago

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

maxsatula commented 2 years ago

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

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 commented 2 years ago

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 commented 2 years ago

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

jart commented 2 years ago

Merged

wchargin commented 2 years ago

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 commented 2 years ago

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

wchargin commented 2 years ago

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

pepa65 commented 1 year ago

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