Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

console use of aview

Help
2005-02-15
2013-05-30
  • Hi all,
    I'd like to use aview as a console filter, like:
    aview < img.ppm > img.txt,

    bu I'm having some problems:
    1) I have to explicitely press 'q' (or kill it) to exit aview
    2) in img.txt I have an initial blank page with just: "Calculating.." in the 1st line,
    and 2 copies of the txt image.
    If I press some keys before 'q', the copies are more than 2 !

    Can somebody please help me on this?

    Thanks

    Alessandro

     
    • Gianni Valenti
      Gianni Valenti
      2005-03-31

      I have the same problem :-(

      But in my case the file img.txt is a binary file...

       
      • it's a bit of time since I had this problem - meanwhile I solved it:
        -) the request of 'q' input was solved by changing the source so that it displays output & exit
        -) the duplicated image problem was solved by using perl on the txt file.

        BTW, I didnt receive any message from the developers, and since the last release was in 2001 my fear is that the project is dead (am I wrong? Please correct me!)

        I found a great alternative (although with an awful name) in libcaca http://sam.zoy.org/projects/libcaca/ - go check it

        Alessandro

         
        • Chunky Kibbles
          Chunky Kibbles
          2005-03-31

          "BTW, I didnt receive any message from the developers, and since the last release was in 2001 my fear is that the project is dead (am I wrong? Please correct me!) "

          Well, I'm not sure that anyone's still working on it. I tried to contact the developers a while ago to get some stuff added to it, but never managed it.

          http://icculus.org/aahelper

          I'm still doing a bit of work with it, though.

          Gary (-;

           
        • hellocatfood
          hellocatfood
          2013-05-23

          Hi!

          What command did you use in the end?

          I've noticed that libcaca can easily output but it is coloured tiles, not only text

           
          • <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> On 05/23/2013 02:53 PM, hellocatfood wrote:

            Hi!

            What command did you use in the end?

            I've noticed that libcaca can easily output but it is coloured tiles, not only text


            console use of aview


            Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/aa-project/discussion/63244/

            To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/


            hi!
            I dont know why but I'm unable to reply directly on the forum...
            anyway, I rechecked - it's a bit of time since I used it, and to my dismay I found out that I get

            cacaviewmod: error while loading shared libraries: libttf.so.2: cannot open shared object file: No such file or directory

            I'm under Fedora13, and I'm unable to debug it further...

            If you dont have this problem, however, this is my small program:


            #!/usr/bin/perl -w

            =begin

                converts the jpg image(s) given as arguments to ascii art, with same name & .png extension

                Requires: jpimage perl module(by alexxx); xwd; ImageMagick


                Usage: for best results, run it in a term having very small font size

            =end
            =cut

            use jpimage;
            use Getopt::Long;

            open(F,">/var/log/aaconvert.log") or die "could not open logfile\n";

            my ($aaname,$parseresult);
            my ($px,$py)=(90,90);
            my $h=0;

            $parseresult=GetOptions(
                                    'help' => \$h,
                                    'px=i' => \$px,
                                    'py=i' => \$py,
                                   );

            die "
            USAGE

            aaconvert.pl [--help] [--px n] [--py n] <jpg files>

            converts the jpg image(s) given as arguments to ascii art, with same name & .png extension

            If the --px and/or --py switches are used, the number n in 0..100 is the crop size in percent
            along the x and y directions (default 90%)

            For best results, run it in a term having very small font size
            "
            if ($h==1);

            foreach(@ARGV)
            {
                next if not(/(.*).JPG/i);
                $aaname=$1.'.png';
                print(F "$_\n$aaname\n\n");
               
                system("clear");

                $ret=imageout(3,$_);
                print $ret;

            #$ret=get_display_img(3,$ARGV[0]); print $ret;
            #`xwd -root -nobdrs -silent -out a.xwd`;

            `xwd -root -silent -out a.xwd`;
            `convert a.xwd a.png`;
            `rm -f a.xwd`;
            `convert a.png -gravity Center -crop $px%x$py%+0+0 a2.png`;
            `mv a2.png $aaname`;
            `rm -f a.png`;

            }
            # print"\n\nmaxwidth=$maxwidth\n";


            close(F);




            --
            
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            /  Dr.Alessandro Magni
            \        Electromagnetics Division
            /        INRiM Strada delle Cacce 91, 10135 Torino (ITALIA)
            \        Email magni@inrim.it
            /        Tel: 0039-011-3919821  Fax: 0039-011-3919834
            \        URL http://www.inrim.it/~magni
            / Our business in life is not to succeed but to continue to fail 
            \ in high spirits.  -- Robert Louis Stevenson
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            </body> </html>