POV-Ray : Newsgroups : povray.general : Size of .tga image : Re: Size of .tga image Server Time
10 Aug 2024 15:17:04 EDT (-0400)
  Re: Size of .tga image  
From: Thorsten Froehlich
Date: 7 Dec 1999 17:59:38
Message: <384d915a@news.povray.org>
In article <K+VMOJjc8SPbYBb12fbq=tY0T+bl@4ax.com> , Peter Popov 
<pet### [at] usanet>  wrote:

>>I ran into this problem as well with my custom compile of POV-Ray.  For
>>unknown reasons, the code for saving TGA images sometimes does not compile
>>properly, and as a result, the most significant byte of the image size is
>>not written properly.  The fix is as follows:
>>
>>In file TARGA.C line 282 or so, fully parenthesize the four lines of code
>>for writing the image width and height, so that you get the following:
>>
>>      /* write width and height  Bytes 12 - 15 */
>>
>>      putc(((*width) % 256), handle->file);
>>      putc(((*width) / 256), handle->file);
>>      putc(((*height) % 256), handle->file);
>>      putc(((*height) / 256), handle->file);
>>
>>Then recompile POV-Ray.  This should fix the problem.
>>
>>Mark
>
> Mark, if this is a bug, and this is a fix (and they seem to be), would
> you please post a proper bug report to povray.bugreports? Thank you.
> This seems to be very platform- and compiler-specific, but still, if
> it is a problem...

No, it is not a bug in POV-Ray! It is a compiler/library specific problem.
The code POV-Ray uses is legal in ANSI C and should work without problems if
the compiler is configured properly and supports ANSI C. It might also just
be a library problem, where the library uses signed char (usually "char" is
signed). I.e. if the library does an assignment like  "int i; char c = i;"
you will get such problems. If you have the source of the library, you can
fix it by searching in function fputc any assignment of the parameter from a
"char" to an "unsigned char".


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.