mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
iml compression improved
This commit is contained in:
parent
906d6b9025
commit
5eb45c638a
1 changed files with 4 additions and 1 deletions
|
|
@ -304,12 +304,13 @@ String SaveIml(const Array<ImlImage>& iml, int format, const String& eol) {
|
|||
out << eol;
|
||||
}
|
||||
|
||||
DLOG("================");
|
||||
int ii = 0;
|
||||
while(ii < iml.GetCount()) {
|
||||
int bl = 0;
|
||||
int bn = 0;
|
||||
Vector<ImageIml> bimg;
|
||||
while(bl < 4096 && ii < iml.GetCount()) {
|
||||
while(ii < iml.GetCount() && (bl == 0 || bl + (int)iml[ii].image.GetLength() < 65536)) {
|
||||
const ImlImage& c = iml[ii++];
|
||||
ImageIml& m = bimg.Add();
|
||||
m.image = c.image;
|
||||
|
|
@ -317,6 +318,8 @@ String SaveIml(const Array<ImlImage>& iml, int format, const String& eol) {
|
|||
bl += (int)c.image.GetLength();
|
||||
bn++;
|
||||
}
|
||||
DDUMP(bimg.GetCount());
|
||||
DDUMP(bl);
|
||||
String bs = PackImlData(bimg);
|
||||
out << eol << "IMAGE_BEGIN_DATA" << eol;
|
||||
bs.Cat(0, ((bs.GetCount() + 31) & ~31) - bs.GetCount());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue