Új hozzászólás Aktív témák

  • Tomm_

    újonc

    Na pont az update-ekkel szopt@am kb. 2 napot, mire rájöttem, hogy a király frissítések miatt nyomatja úgy ki a fotókat a nyomtatóm, hogy a közepe konkréten fehér.
    Tudom, hogy driverek jönnek a frissítésekkel, észrevettem, hogy a laptomom második videokártyájának is megtalálta a hozzá illő driverét, stb.

    Inkább az a gondom, hogy egyrészt nem tudom változtatni az alapértelmezett programot, de főleg az, hogy valami androidos f@sság miatt nem nyitja meg a klasszik képnézegető.

    Amit meg találtam, abból sajna nem értem a felét:

    For any Android developers who may come across this: Seems that Windows Photo Viewer doesn't like the ICC profile metadata that Bitmap.compress writes (maybe it doesn't like any ICC profiles actually? I haven't checked).
    Here's a way to simply strip out that metadata segment from the JPEG file, which results in a JPEG that is compatible with Windows Photo Viewer again:

    // Some image viewer applications
    (such as Windows Photo Viewer)
    doesn't seem to like the ICC profile meta data that Android's
    Bitmap.compress writes.     // This decorator removes the
    section.     private static class RemoveFFE2O
    utputStreamDecorator extends OutputStream {         OutputStream underlyingStream;         boolean marker = false;         boolean skipSegment = false;
            public RemoveFFE2OutputStreamDecorator
    (OutputStream underlyingStream) {             this.underlyingStream = underlyingStream;
            }         @Override
            public void write(int b)
    throws IOException {             // Based on https://en.wikipedia.org/wiki/JPEG#Syntax_
    and_structure
                if (this.marker) {
                    this.marker = false;                 if ((b & 0xFF) == 0xE2) {
    // The 0xFF,0xE2 segment
    that Android writes seems to cause trouble w
    ith Windows Photo Viewer.                     this.skipSegment = true;                 } else {
                        this.skipSegment = false;                     this.underlyingStream.write
    (0xFF);                     this.underlyingStream.write(b);                 }             } else if ((b & 0xFF) == 0xFF) {
                    this.marker = true;             } else if (!this.skipSegment) {
                    this.underlyingStream.write(b);
                }
            }         @Override         public void flush() throws IOException
    {             this.underlyingStream.flush();
            }         @Override         public void close() throws IOExcept
    ion {             this.underlyingStr
    eam.close();         }     }

    :Y

    [ Szerkesztve ]

Új hozzászólás Aktív témák