image.SetMask( M_IMGDATA->m_hasMask );
memcpy( data, GetData(), M_IMGDATA->m_width*M_IMGDATA->m_height*3 );
-
- // also copy the image options
+
wxImageRefData *imgData = (wxImageRefData *)image.m_refData;
+
+ // also copy the alpha channel
+ if (HasAlpha())
+ {
+ image.SetAlpha();
+ unsigned char* alpha = image.GetAlpha();
+ memcpy( alpha, GetAlpha(), M_IMGDATA->m_width*M_IMGDATA->m_height );
+ }
+
+ // also copy the image options
imgData->m_optionNames = M_IMGDATA->m_optionNames;
imgData->m_optionValues = M_IMGDATA->m_optionValues;
return false;
}
- if (!handler->CanRead(stream))
+ if (stream.IsSeekable() && !handler->CanRead(stream))
{
wxLogError(_("Image file is not of type %d."), type);
return false;
return false;
}
- if (!handler->CanRead(stream))
+ if (stream.IsSeekable() && !handler->CanRead(stream))
{
wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype);
return false;