Java Null Pointer Exception while writting image

Hi!

Thanks for the response, I’ll try to do that the next days.

For the moment, I found a workaround that is to close the product and reopen it again:

    faiProduct.closeIO()
    
    # Write GT
    product = ProductIO.readProduct(dimmap_dir + '/snappy_fai_' + date + '.dim')
    fai = product.getBand("fai")

    write_rgb_image([fai, fai, fai], String(gt_dir + '/snappy_fai_' + date + '.png'), image_format)
   
    product.closeIO()

With that, I don’t found the error when use the write_rgb_image function.

I think that is strange that with this will work, but this idea come to my mind because if I save the .dim archive, I can open the RGB image with the Snap desktop APP.

Thanks again for the response!

Álvaro

1 Like