compiling dcraw, a raw file to ppm convertor - SGI

This is a discussion on compiling dcraw, a raw file to ppm convertor - SGI ; Hi, I've a new Nikon D70 Digital SLR camera and I want to process my images on my O2 I've found this cool C program that can convert my raw 'ccd memory dump files' from my nikon D70 to ppm ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: compiling dcraw, a raw file to ppm convertor

  1. compiling dcraw, a raw file to ppm convertor

    Hi,
    I've a new Nikon D70 Digital SLR camera and I want to process my images on
    my O2

    I've found this cool C program that can convert my raw 'ccd memory dump
    files' from my nikon D70 to ppm format images. But I can compile and use
    the code on my linux box but not on my O2. Can anyone help with info.

    Looks like the problem is
    "/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../../libjpeg.so is
    o32.
    collect2: ld returned 4 exit status"

    but not sure what I need to do. Any of you C programers for irix have any
    good idea's?


    Heres the website and links for download

    http://www.cybercom.net/~dcoffin/dcraw/

    and the c program is
    http://www.cybercom.net/~dcoffin/dcraw/dcraw.c

    The compiler options are "gcc -o dcraw -O3 dcraw.c -lm -ljpeg"

    trying to compile it on my Indy gives this error

    gcc -o dcraw -O3 dcraw.c -lm -ljpeg
    ld32: FATAL 12: Expecting n32 objects:
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../../libjpeg.so is o32.
    collect2: ld returned 4 exit status

    Trying to compile on my Octane2 at work gives


    gcc -o dcraw -O3 dcraw.c -lm -ljpeg
    dcraw.c: In function `canon_compressed_load_raw':
    dcraw.c:479: warning: assignment makes pointer from integer without a cast
    dcraw.c: In function `nikon_compressed_load_raw':
    dcraw.c:678: warning: assignment makes pointer from integer without a cast
    dcraw.c: In function `leaf_load_raw':
    dcraw.c:1012: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `unpacked_load_raw':
    dcraw.c:1043: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `olympus_e300_load_raw':
    dcraw.c:1080: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `eight_bit_load_raw':
    dcraw.c:1116: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `nucore_load_raw':
    dcraw.c:1150: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `kodak_easy_load_raw':
    dcraw.c:1392: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `foveon_interpolate':
    dcraw.c:1739: warning: assignment makes pointer from integer without a
    cast
    dcraw.c:1847: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `bad_pixels':
    dcraw.c:1925: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `vng_interpolate':
    dcraw.c:2164: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `parse_foveon':
    dcraw.c:2771: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `fuji_rotate':
    dcraw.c:3999: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `flip_image':
    dcraw.c:4035: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `write_ppm':
    dcraw.c:4094: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `write_psd':
    dcraw.c:4143: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `write_ppm16':
    dcraw.c:4179: warning: assignment makes pointer from integer without a
    cast
    dcraw.c: In function `main':
    dcraw.c:4320: warning: assignment makes pointer from integer without a
    cast
    dcraw.c:4361: warning: assignment makes pointer from integer without a
    cast
    ld32: FATAL 12: Expecting n32 objects:
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../../libjpeg.so is o32.
    collect2: ld returned 4 exit status


    *********************
    Khalid Schofield
    System Administrator / EM Technician
    Dept. Of Materials
    University Of Oxford
    Parks Road
    Oxford
    OX1 3PH

    Email: khalid.schofield@materials.ox.ac.uk
    Tel: 01865 273785
    Fax: 01865 283333
    Web: http://www-em.materials.ox.ac.uk/peo...eld/index.html

    GNU Humour 'Technical Thug'

    http://www.gnu.org/fun/jokes/know.your.sysadmin.html

    ooooo ooo o8o
    `888' `8' `"'
    888 8 ooo. .oo. oooo oooo ooo
    888 8 `888P"Y88b `888 `88b..8P'
    888 8 888 888 888 Y888'
    `88. .8' 888 888 888 .o8"'88b
    `YbodP' o888o o888o o888o o88' 888o http://www.unix.org/


  2. Re: compiling dcraw, a raw file to ppm convertor

    Khalid Schofield writes:

    > Looks like the problem is
    > "/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../../libjpeg.so is
    > o32.
    > collect2: ld returned 4 exit status"


    Compile your own libjpeg and compile the app against that instead of
    using the o32 version from freeware.

    --
    Atro Tossavainen (Mr.) / The Institute of Biotechnology at
    Systems Analyst, Techno-Amish & / the University of Helsinki, Finland,
    +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own.
    < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS

  3. Re: compiling dcraw, a raw file to ppm convertor

    I tried doing that but ran into more errors. I contacted the author and he
    said just throw away the jpeg bit as only kodak needs it and I'm using a
    Nikon D70. All working now.

    Also the other problem was by default dcraw autolevels the images for
    brightnedd and contrast. My night shots looked REALLY nasty with this.

    I'm using dcraw -4 to convert to a liniar ppm image now then converting it
    to tga but I think I'll install ppmtotiff as tiffs are better than tga's

    I've another problem though. I want my script to produce file names

    DSC_XXX.tga but at the moment it's doing

    DSC_XXX.ppm.tga

    I know why it does this because my variable is DSC_XXX.ppm and when it
    makes the new file it just does $i.tga

    heres the script anyway. Anyone any tips? Don't laugh too much it's just
    two for loops in bash lol

    #!/usr/freeware/bin/bash
    for i in *.NEF
    do
    /usr/local/bin/dcraw -4 $i
    done

    for p in *.ppm
    do
    /usr/freeware/bin/ppmtotga $p > $p.tga
    rm $p
    done


    any idea's?

    *********************
    Khalid Schofield
    System Administrator / EM Technician
    Dept. Of Materials
    University Of Oxford
    Parks Road
    Oxford
    OX1 3PH

    Email: khalid.schofield@materials.ox.ac.uk
    Tel: 01865 273785
    Fax: 01865 283333
    Web: http://www-em.materials.ox.ac.uk/peo...eld/index.html

    GNU Humour 'Technical Thug'

    http://www.gnu.org/fun/jokes/know.your.sysadmin.html

    ooooo ooo o8o
    `888' `8' `"'
    888 8 ooo. .oo. oooo oooo ooo
    888 8 `888P"Y88b `888 `88b..8P'
    888 8 888 888 888 Y888'
    `88. .8' 888 888 888 .o8"'88b
    `YbodP' o888o o888o o888o o88' 888o http://www.unix.org/


    On Wed, 26 Jan 2005, Atro Tossavainen wrote:

    > Khalid Schofield writes:
    >
    > > Looks like the problem is
    > > "/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../../libjpeg.so is
    > > o32.
    > > collect2: ld returned 4 exit status"

    >
    > Compile your own libjpeg and compile the app against that instead of
    > using the o32 version from freeware.
    >
    > --
    > Atro Tossavainen (Mr.) / The Institute of Biotechnology at
    > Systems Analyst, Techno-Amish & / the University of Helsinki, Finland,
    > +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own.
    > < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS
    >


  4. Re: compiling dcraw, a raw file to ppm convertor

    Khalid Schofield writes:

    > for p in *.ppm
    > do
    > /usr/freeware/bin/ppmtotga $p > $p.tga
    > rm $p
    > done


    From what I can see, it's doing exactly what you are telling it to
    (which is different from what you want, but computers are like that...
    they don't have a DO WHAT I MEAN button, they do what you tell them
    to... this stinks, it should be corrected in the next release of
    Computers, Inc.)

    Your script says:

    "For every file whose name ends in .ppm, run the ppmtotga program
    with the file name as the parameter and put the standard output
    from that program in a file that has the same name as the original
    with .tga added at the end"

    There is no magic that would perform the name substitution you want,
    but the following bit does it without the requirement for magic being
    involved:

    /usr/freeware/bin/ppmtotga $p > `echo $p | sed "s/ppm/tga/"`

    --
    Atro Tossavainen (Mr.) / The Institute of Biotechnology at
    Systems Analyst, Techno-Amish & / the University of Helsinki, Finland,
    +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own.
    < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS

  5. Re: compiling dcraw, a raw file to ppm convertor

    yup
    thanks for info
    as I stated it's outputing to
    $i.tga which isn't what I want it to do but I know it's doing what I'm
    telling it to do. I was saying I don't have a clue not I expect the
    computer to know what I'm thinking lol

    I was admiting to be clueless not the shell being at fault heehee

    thanks for info. I'll give it a whirl

    *********************
    Khalid Schofield
    System Administrator / EM Technician
    Dept. Of Materials
    University Of Oxford
    Parks Road
    Oxford
    OX1 3PH

    Email: khalid.schofield@materials.ox.ac.uk
    Tel: 01865 273785
    Fax: 01865 283333
    Web: http://www-em.materials.ox.ac.uk/peo...eld/index.html

    GNU Humour 'Technical Thug'

    http://www.gnu.org/fun/jokes/know.your.sysadmin.html

    ooooo ooo o8o
    `888' `8' `"'
    888 8 ooo. .oo. oooo oooo ooo
    888 8 `888P"Y88b `888 `88b..8P'
    888 8 888 888 888 Y888'
    `88. .8' 888 888 888 .o8"'88b
    `YbodP' o888o o888o o888o o88' 888o http://www.unix.org/


    On Thu, 27 Jan 2005, Atro Tossavainen wrote:

    > Khalid Schofield writes:
    >
    > > for p in *.ppm
    > > do
    > > /usr/freeware/bin/ppmtotga $p > $p.tga
    > > rm $p
    > > done

    >
    > From what I can see, it's doing exactly what you are telling it to
    > (which is different from what you want, but computers are like that...
    > they don't have a DO WHAT I MEAN button, they do what you tell them
    > to... this stinks, it should be corrected in the next release of
    > Computers, Inc.)
    >
    > Your script says:
    >
    > "For every file whose name ends in .ppm, run the ppmtotga program
    > with the file name as the parameter and put the standard output
    > from that program in a file that has the same name as the original
    > with .tga added at the end"
    >
    > There is no magic that would perform the name substitution you want,
    > but the following bit does it without the requirement for magic being
    > involved:
    >
    > /usr/freeware/bin/ppmtotga $p > `echo $p | sed "s/ppm/tga/"`
    >
    > --
    > Atro Tossavainen (Mr.) / The Institute of Biotechnology at
    > Systems Analyst, Techno-Amish & / the University of Helsinki, Finland,
    > +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own.
    > < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS
    >


+ Reply to Thread