1. Bolin's pcx reader

Hello all;

I am trying to use Michael Bolin's PCX and GIF loading code for the
        first
time, and have run into a problem.  The GIF part works fine, but I cannot
get the PCX reader to work under any circumstances.  The PCX files I am
using are definately not corrupted (tested under several graphics viewers)
.  I am not at all familiar with picture formats, so at the moment I cannot
even begin to diagnose the problem, other than the fact that it seems to
think *any* pcx file is in the improper format.
        Immediately after posting this I will be looking into learning what the
proper format should be, so I'm not concerned about bothering you guys with
questions about picture formats per se;  I'm just curious if anyone might
know offhand if there is something buggy about that part of the code.
        If Mr. Bolin  should see this, here is the exact part of the code that
kicks out with error return(Not euphoria error, this routine's error return):

procedure read_pcx_header()
        blah    (palette, x and y mins and maxes, bits per pixel read up
        blah     here)
        blah
        if getc(file_num) then  <<----BOOM!
                exit_flag = PCX_UNSUPPORTED_FORMAT
                return
        end if
        blah
        blah
        blah
end procedure

If I understand it properly, that statement means that at that
        particular
part of the pcx header there should be a byte of value zero and nothing
else in order for the code not to exit.  However, in the pcx files I am
using there obviously is some other value there, every time.
        Any help would be appreciated.
Later,
Craig

new topic     » topic index » view message » categorize

2. Re: Bolin's pcx reader

>         I am trying to use Michael Bolin's PCX and GIF loading code for the fi
rst
> time, and have run into a problem.  The GIF part works fine, but I cannot
> get the PCX reader to work under any circumstances.  The PCX files I am
> using are definately not corrupted (tested under several graphics viewers)
> .  I am not at all familiar with picture formats, so at the moment I cannot
> even begin to diagnose the problem, other than the fact that it seems to
> think *any* pcx file is in the improper format.
>         Immediately after posting this I will be looking into learning what th
e
> proper format should be, so I'm not concerned about bothering you guys with
> questions about picture formats per se;  I'm just curious if anyone might
> know offhand if there is something buggy about that part of the code.
>         If Mr. Bolin  should see this, here is the exact part of the code that
> kicks out with error return(Not euphoria error, this routine's error return):
>
> procedure read_pcx_header()
>         blah    (palette, x and y mins and maxes, bits per pixel read up
>         blah     here)
>         blah
>         if getc(file_num) then  <<----BOOM!
>                 exit_flag = PCX_UNSUPPORTED_FORMAT
>                 return
>         end if
>         blah
>         blah
>         blah
> end procedure
>
>         If I understand it properly, that statement means that at that particu
lar
> part of the pcx header there should be a byte of value zero and nothing
> else in order for the code not to exit.  However, in the pcx files I am
> using there obviously is some other value there, every time.
>         Any help would be appreciated.

Are the PCX files you are using any format such as 24-bit (or
anything over 256 colors)?

The PCX file format documentation I used to write the routine
definitely stated that this byte should contain a zero, and all the
PCX files I tested worked. The document may have been wrong, so
try replacing this check with a simple:

    if getc(file_num) then end if

This will just read one byte and ignore it. Try this and tell me what
happens. Also, if your PCX files aren't too big, you could send me
one of them at: michaeltom at geocities.com

Regards,
               Michael Bolin

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu