Thread: tifftopnm

  1. #1
    Wanabe Laser Engineer chico1st's Avatar
    Join Date
    Jul 2007
    Posts
    168

    tifftopnm

    I am having issues using tifftopnm
    Tifftopnm User Manual

    By issues I mean I would like to send in an image and get out another image but i just get gibberish to my screen

    the manual for this confuses me but if I use tifftopnm Lena.tiff in dos i get gibberish. Is that because I should be using this in a program just as a function call?

    It has been a long time since I have used C how would I write a program to use this and then write the image? is it just a binary write?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Code:
    tifftopnm inputimage.tif > outputimage.pnm
    The man page clearly states that the data is written to stdout.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by chico1st View Post
    the manual for this confuses me but if I use tifftopnm Lena.tiff in dos i get gibberish. Is that because I should be using this in a program just as a function call?
    Nope. It's a program; it is not part of a C library.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    Wanabe Laser Engineer chico1st's Avatar
    Join Date
    Jul 2007
    Posts
    168
    so is
    Code:
    -alphaout={alpha-filename,-}
    the outputfile name?

    How do i make it not print gibberish?
    Last edited by chico1st; 05-12-2009 at 04:46 PM.

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    The gibberish is the file! You redirect the output from stdout to the filename that you want

    Using command redirection operators

    The -alphaout is if you want some other part, the alpha channel, to go to a PGM file

  6. #6
    Wanabe Laser Engineer chico1st's Avatar
    Join Date
    Jul 2007
    Posts
    168
    wow I've never seen that before... is that a c++ thing?

  7. #7
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by chico1st View Post
    wow I've never seen that before... is that a c++ thing?
    No! It is the (dos) shell. tifftopnm is a program that outputs to stdout (the console). If you redirect (>) the output, the shell will put that output in a file.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed