[l2h] Some png do not match with ps files

Roman A. Semizarov Roman A. Semizarov" <roma7@bigfoot.com
Tue, 5 Dec 2000 03:59:40 +0300 (MSK)


> Sometimes the conversion of ps files into png files (under w2k) does not
> work properly for me. For each ps file there is a png file, but some of
> them
> do not match. The images.dvi file is fine, but not the final html file.
> Something similar happens in the conversion of math symbols: \delta is
> shown
> instead of \theta. Any idea?

It is true.
May be I even understood the matter.

Let us see to the code of &find_unique.

    local($/) = undef;
...
    if(open(IMG1,"<$image1")) {
        $imagedata = <IMG1>;
        close(IMG1);}
...

    foreach $image2 (keys(%image_size)) {
        if ( $image1 ne $image2 &&
            $image_size{$image1} eq $image_size{$image2} ) {
            if(open(IMG2,$image2)) {
                $result = ($imagedata eq <IMG2>);
                close(IMG2);
            }


We think, that it puts the contents of $image1 to $imagedate,
and compares with contents of all image files with the same size.

But!

The author have forgotten to use  binmode for IMG1 and IMG2.

So the files are being read only till the EOF symbol!
And in the WinDOS systems the EOF symbol is ^Z, which is also
the fifth symbol of any .PNG file...

Roman