GitHub user smurching opened a pull request:

    https://github.com/apache/spark/pull/20389

    [SPARK-23205][ML] Update ImageSchema.readImages to correctly set alpha 
values for four-channel images

    ## What changes were proposed in this pull request?
    
    When parsing raw image data in ImageSchema.decode(), we use a 
[java.awt.Color](https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html#Color(int))
 constructor that sets alpha = 255, even for four-channel images (which may 
have different alpha values). This PR fixes this issue & adds a unit test to 
verify correctness of reading four-channel images.
    
    ## How was this patch tested?
    
    Updates an existing unit test ("readImages pixel values test" in 
`ImageSchemaSuite`) to also verify correctness when reading a four-channel 
image.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/smurching/spark image-schema-bugfix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/20389.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #20389
    
----
commit 054c1dd457e5c95872a188f7978f678d7c7093d5
Author: Sid Murching <sid.murching@...>
Date:   2018-01-24T22:34:08Z

    Bugfix + test

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to