POV-Ray : Newsgroups : povray.binaries.programming : ppm.cpp patch Server Time: 12 Dec 2018 09:17:45 GMT
  ppm.cpp patch (Message 1 to 5 of 5)  
From: PoD
Subject: ppm.cpp patch
Date: 25 Jan 2003 12:19:04
Message: <3e3280b8@news.povray.org>
As reported in p.g, POV-Ray 3.5 does not read PPM files properly.
The proper format is
P6
width height
max_value
data

The POV reader expects the max_value on the same line as the width and 
height.  If you don't want to patch POV-Ray, you can edit the PPM files 
to make them work in POV.

Here's a patch to fix it. I only spent a short time on this, so it's 
probably still broken but it loads the files that I've tried.

-- 
PoD.


Post a reply to this message


Attachments:
Download 'us-ascii' (2 KB)

From: Christoph Hormann
Subject: Re: ppm.cpp patch
Date: 25 Jan 2003 12:30:59
Message: <3E328383.AF4EAC00@gmx.de>
PoD wrote:
> 
> As reported in p.g, POV-Ray 3.5 does not read PPM files properly.
> The proper format is
> P6
> width height
> max_value
> data
> 

Just for the record, the only rule for spacing in the header of a ppm is
that between the values there is one or more whitespace (before the data
in binary ppm's only one whitespace is allowed).

Concerning your patch - i have not tested it but i never had problems
reading ppm's with POV-Ray.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: PoD
Subject: Re: ppm.cpp patch
Date: 25 Jan 2003 13:43:45
Message: <pan.2003.01.25.13.43.44.95289@internode.on.net>
On Sat, 25 Jan 2003 13:30:59 +0100, Christoph Hormann wrote:

> 
> 
> PoD wrote:
>> 
>> As reported in p.g, POV-Ray 3.5 does not read PPM files properly. The
>> proper format is
>> P6
>> width height
>> max_value
>> data
>> 
>> 
> Just for the record, the only rule for spacing in the header of a ppm is
> that between the values there is one or more whitespace (before the data
> in binary ppm's only one whitespace is allowed).

But most if not all PPMs use the above format, possibly with comments as
well.

> 
> Concerning your patch - i have not tested it but i never had problems
> reading ppm's with POV-Ray.
> 

That's odd because the ppm code in 3.5a does not read normal PPM files.


Post a reply to this message

From: PoD
Subject: Re: ppm.cpp patch
Date: 25 Jan 2003 13:49:05
Message: <pan.2003.01.25.13.49.04.207903@internode.on.net>
I just looked at the code again, I'll change the code to skip all
white space and comments.


Post a reply to this message

From: tth
Subject: Re: ppm.cpp patch
Date: 30 Jul 2003 01:55:01
Message: <web.3f2724af2009e4961c9f49180@news.povray.org>
PoD wrote:
>I just looked at the code again, I'll change the code to skip all
>white space and comments.

  man ppm says that:

       - Whitespace (blanks, TABs, CRs, LFs).


Post a reply to this message

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