- if(has_alpha) {
- if(num_colors<=256 || sizex<8 || sizey<8) {
- i->tag = swf_InsertTag(i->tag,ST_DEFINEBITSLOSSLESS2);
- swf_SetU16(i->tag, bitid);
- swf_SetLosslessImage(i->tag,mem,sizex,sizey);
- } else {
- /*TODO: check what is smaller */
- i->tag = swf_InsertTag(i->tag,ST_DEFINEBITSJPEG3);
- swf_SetU16(i->tag, bitid);
- swf_SetJPEGBits3(i->tag,sizex,sizey,mem,config_jpegquality);
- //swf_SetLosslessImage(i->tag,mem,sizex,sizey);
- }
- } else {
- if(num_colors<=256 || sizex<8 || sizey<8) {
- i->tag = swf_InsertTag(i->tag,ST_DEFINEBITSLOSSLESS);
- swf_SetU16(i->tag, bitid);
- swf_SetLosslessImage(i->tag,mem,sizex,sizey);
- } else {
- /*TODO: check what is smaller */
- i->tag = swf_InsertTag(i->tag,ST_DEFINEBITSJPEG2);
- swf_SetU16(i->tag, bitid);
- swf_SetJPEGBits2(i->tag,sizex,sizey,mem,config_jpegquality);
- //swf_SetLosslessImage(i->tag,mem,sizex,sizey);
- }
- }
-