git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
seed random from ruby interface
[swftools.git]
/
lib
/
modules
/
swfbits.c
diff --git
a/lib/modules/swfbits.c
b/lib/modules/swfbits.c
index
1e32cf2
..
c2dcf25
100644
(file)
--- a/
lib/modules/swfbits.c
+++ b/
lib/modules/swfbits.c
@@
-887,6
+887,7
@@
void swf_SetLosslessImage(TAG*tag, RGBA*data, int width, int height)
tag->id = ST_DEFINEBITSLOSSLESS;
} else {
tag->id = ST_DEFINEBITSLOSSLESS2;
tag->id = ST_DEFINEBITSLOSSLESS;
} else {
tag->id = ST_DEFINEBITSLOSSLESS2;
+ /* FIXME: we're destroying the callers data here */
swf_PreMultiplyAlpha(data, width, height);
}
num = swf_ImageGetNumberOfPaletteEntries(data, width, height, 0);
swf_PreMultiplyAlpha(data, width, height);
}
num = swf_ImageGetNumberOfPaletteEntries(data, width, height, 0);
@@
-1169,7
+1170,8
@@
TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali
#endif
#if defined(HAVE_JPEGLIB)
#endif
#if defined(HAVE_JPEGLIB)
- /* try jpeg image */
+ /* try jpeg image. Notice that if (and only if) we tried the lossless compression
+ above, the data will now be premultiplied with alpha. */
if(has_alpha) {
tag2 = swf_InsertTag(0, ST_DEFINEBITSJPEG3);
swf_SetU16(tag2, bitid);
if(has_alpha) {
tag2 = swf_InsertTag(0, ST_DEFINEBITSJPEG3);
swf_SetU16(tag2, bitid);