On Thu, 24 Mar 2022 07:50:59 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> yes
>
> As far as I understand the in the read code we create a DataBufferByte so 
> later we can use the cast. But in this method we do not create it, and use 
> what the user provide to us, can the user "craft custom " raster/metadata and 
> the cs type?

Yes we do. This raster is created here in the ImageWriter as follows 

        // Create an appropriate 1-line databuffer for writing
        int lineSize = sourceWidth*numBandsUsed;

        DataBufferByte buffer = new DataBufferByte(lineSize);

        // Create a raster from that
        int [] bandOffs = JPEG.bandOffsets[numBandsUsed-1];

        raster = Raster.createInterleavedRaster(buffer,
                                                sourceWidth, 1,
                                                lineSize,
                                                numBandsUsed,
                                                bandOffs,
                                                null);

-------------

PR: https://git.openjdk.java.net/jdk/pull/7849

Reply via email to