Using the control, breaks the app when the image has 0 bytes. I was testing uploads with my new fuseapp in iOS, and when I try to show an image that previously didn’t upload (but the file was saved as 0 bytes) the app crashed.
The XCode debugger shows break in this line uBase::Auto<uImage::ImageReader> ir = uImage::Jpeg::CreateReader(bs);
This occurs on the method:
// public static void JpegByteArrayToTexture2D(Uno.Buffer arr, Experimental.TextureLoader.Callback callback) [static] :125
void TextureLoaderImpl::JpegByteArrayToTexture2D(::g::Uno::Buffer arr_, ::g::Experimental::TextureLoader::Callback callback_)
{
uStackFrame ("Experimental.TextureLoader.TextureLoaderImpl", "JpegByteArrayToTexture2D(Uno.Buffer,Experimental.TextureLoader.Callback)");
try
{
uBase::Auto<uBase::BufferPtr> bp = new uBase::BufferPtr(U_BUFFERPTR(arr), U_BUFFERSIZE(arr), false);
uBase::Auto<uBase::BufferStream> bs = new uBase::BufferStream(bp, true, false);
uBase::Auto<uImage::ImageReader> ir = uImage::Jpeg::CreateReader(bs);
uBase::Auto<uImage::Bitmap> bmp = ir->ReadBitmap();
uBase::Auto<uImage::Texture> tex = uImage::Texture::Create(bmp);
uGLTextureInfo info;
GLuint handle = uCreateGLTexture(tex, false, &info);
callback_->Execute(::g::Uno::Graphics::Texture2D::New2(handle, ::g::Uno::Int2New2(info.Width, info.Height), info.MipCount, 0));
}
catch (const uBase::Exception &e)
{
throw uThrowable(::g::Uno::Exception::New2(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
}
}
Fuse Version: 0.21.0 Build: 6650 OSX