mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-25 06:56:29 +00:00
Fixed #2224 Exporting Embed assets - handling DefineBits(+JPEGTables) - convert to DefineBitsJPEG2
This commit is contained in:
@@ -38,6 +38,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#2202] AS2 detection of uninitialized class fields colliding with setters/getters
|
||||
- [#2202] AS2 return in constructor does not take a value
|
||||
- [#2222] Missing shapes when gradient fillstyle has only two gradrecords with the same ratio
|
||||
- [#2224] Exporting Embed assets - handling DefineBits(+JPEGTables) - convert to DefineBitsJPEG2
|
||||
|
||||
### Changed
|
||||
- [#2185] MochiCrypt no longer offered for auto decrypt, user needs to choose variant from "Use unpacker" menu
|
||||
@@ -3405,6 +3406,7 @@ Major version of SWF to XML export changed to 2.
|
||||
[#2212]: https://www.free-decompiler.com/flash/issues/2212
|
||||
[#2202]: https://www.free-decompiler.com/flash/issues/2202
|
||||
[#2222]: https://www.free-decompiler.com/flash/issues/2222
|
||||
[#2224]: https://www.free-decompiler.com/flash/issues/2224
|
||||
[#2206]: https://www.free-decompiler.com/flash/issues/2206
|
||||
[#2100]: https://www.free-decompiler.com/flash/issues/2100
|
||||
[#2123]: https://www.free-decompiler.com/flash/issues/2123
|
||||
|
||||
@@ -64,6 +64,8 @@ import com.jpexs.decompiler.flash.exporters.settings.ScriptExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.SoundExportSettings;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineBitsTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineFont4Tag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSoundTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
||||
@@ -82,6 +84,7 @@ import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import com.jpexs.helpers.CancellableWorker;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.Path;
|
||||
@@ -91,6 +94,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -570,12 +574,25 @@ public class AS3ScriptExporter {
|
||||
st.getNeededCharactersDeep(neededCharacters);
|
||||
neededCharacters.add(st.spriteId);
|
||||
}
|
||||
for (int n : neededCharacters) {
|
||||
for (int n : neededCharacters) {
|
||||
CharacterTag ct = (CharacterTag) swf.getCharacter(n);
|
||||
if (ct == null) {
|
||||
continue;
|
||||
}
|
||||
ct.writeTag(sos2);
|
||||
if (ct instanceof DefineBitsTag) {
|
||||
//Convert DefineBits+(global)JPEGTables to standalone DefineBitsJPEG2 so they do not share same JPEGTables anymore
|
||||
DefineBitsTag db = (DefineBitsTag) ct;
|
||||
InputStream isd = db.getOriginalImageData();
|
||||
if (isd == null) {
|
||||
continue;
|
||||
}
|
||||
DefineBitsJPEG2Tag dbj2 = new DefineBitsJPEG2Tag(swf);
|
||||
dbj2.characterID = db.characterID;
|
||||
dbj2.imageData = new ByteArrayRange(Helper.readStream(isd));
|
||||
dbj2.writeTag(sos2);
|
||||
} else {
|
||||
ct.writeTag(sos2);
|
||||
}
|
||||
for (String cls : ct.getClassNames()) {
|
||||
symbolClassIds.add(ct.getCharacterId());
|
||||
symbolClassNames.add(cls);
|
||||
|
||||
Reference in New Issue
Block a user