Github user MrBago commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20168#discussion_r160267553
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/image/ImageSchema.scala 
---
    @@ -143,12 +174,12 @@ object ImageSchema {
     
           val height = img.getHeight
           val width = img.getWidth
    -      val (nChannels, mode) = if (isGray) {
    -        (1, ocvTypes("CV_8UC1"))
    +      val (nChannels, mode: Int) = if (isGray) {
    --- End diff --
    
    In the code bellow we always call `toBytes` per channel so everything will 
be cast to a 1 byte per channel image type. I think this is fine for standard 
image types (ie, jpg, png, and the like).
    
    Technically you can register image readers in java and use a BufferedImage 
of `TYPE_CUSTOM` for more complex images, but in practice I think we'll want to 
take a very different code path for these complex images so we'll want to 
introduce a new method if we add support to handle them.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to