I am reading a alpha channel of a DICOM file which has the image data , after that I am parsing and rendering it using this tutorial , in addition to that I am forwarding the alpha channel to a webgl program to render the texture.
However, it works for few images , it also fails for some. Here are few use cases :
SNO Width Height Status
Width : 628 , Height : 888, Length of alpha channel : 557664 (Works fine).
Width : 448 , Height : 612, Length of alpha channel : 274176(Works fine).
Width : 446 , Height : 612, Length of alpha channel : 272952(Doesn't work).
Width : 2219 , Height : 1200, Length of alpha channel : 2662800(Doesn't work).
And for Use case 3 and 4 I get these error messages :
- Error: WebGL: texImage2D: Provided buffer is too small. (needs 2663999, has 2662800)
- Error: WebGL: generateMipmap: The base level of the texture does not have power-of-two dimensions.
Any suggestions ?