Writing several images into a single binary file



Hi all,

I have been successfully writing and reading images to/from binary files just with the image size on the first row and then all the pixel values sequentially, through the read/write functions (I use C++).

Now, I would like to join few images in a single file, separating the single images from each other by a text comment. This usually works, but, sometimes, one of the images is misread and when I check the file, I see an empty line where instead the image was supposed to start. This newline, somehow, screws everything up and the image following it gets completely rubbish.

I am writing greyscale images, a float for each pixel. I use Visual C++ and Win2000.

What would be your suggestion to solve this problem?

Thanks.
.



Relevant Pages

  • Re: Differential intra-interchannel filters for RGB images lossless compression
    ... >>> However IMHO many photographic images are even slightly more difficult ... don't look right, lighting doesn't look right, surfaces are almost always ... compression, it seems concievable to me that they could. ... would likely be able to fairly accurately predict the pixel. ...
    (comp.compression)
  • Re: How many megapixcels equivalent to 35 mm in quality
    ... with higher pixel densities. ... and upsampled our images to view them in their ... very little perception of noise in the recent high-density sensors. ... Our viewing options are horrible. ...
    (rec.photo.digital)
  • Re: Why is the pixel count growing so slowly?
    ... Megapixels are not the only factor in image quality. ... The fact that relatively low megapixel count images look ... Pixel count is not growing as fast anymore because pixel size ... Factors in Choosing a Digital Camera ...
    (rec.photo.digital)
  • Re: OS X.4.X update...
    ... todays macintosh, it's really almost exactly the same as the 128k ... and the Net Effect that you Still Want, Is to control every pixel. ... incremental features, which basically boil down to Graphical ... Which allow you to easily blend colours and twist images around... ...
    (comp.sys.mac.system)
  • Re: Why is the pixel count growing so slowly?
    ... The fact that relatively low megapixel count images look ... e.g. 8 megapixels of large pixels versus ... Pixel count is not growing as fast anymore because pixel size ... Factors in Choosing a Digital Camera ...
    (rec.photo.digital)