wow
@ -105,8 +105,6 @@ func (n *Nori) ExportAnimation(num int) (*apng.APNG, error) {
|
|||||||
)
|
)
|
||||||
fr := apng.Frame{
|
fr := apng.Frame{
|
||||||
Image: big,
|
Image: big,
|
||||||
DisposeOp: apng.DISPOSE_OP_PREVIOUS,
|
|
||||||
BlendOp: apng.BLEND_OP_OVER,
|
|
||||||
DelayDenominator: 1000,
|
DelayDenominator: 1000,
|
||||||
}
|
}
|
||||||
if g.Images[i].Delay != 0 {
|
if g.Images[i].Delay != 0 {
|
||||||
@ -114,5 +112,6 @@ func (n *Nori) ExportAnimation(num int) (*apng.APNG, error) {
|
|||||||
}
|
}
|
||||||
a.Frames = append(a.Frames, fr)
|
a.Frames = append(a.Frames, fr)
|
||||||
}
|
}
|
||||||
|
log.Println(num, len(a.Frames))
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,9 @@ func TestParsePalette(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func writeApng(nori *Nori, name string) error {
|
func writeApng(nori *Nori, name string) error {
|
||||||
|
postfix := ".example"
|
||||||
out := new(bytes.Buffer)
|
out := new(bytes.Buffer)
|
||||||
os.MkdirAll("./nori_test/"+name+".out", 0740)
|
os.MkdirAll(fmt.Sprintf("./nori_test/%s%s", name, postfix), 0740)
|
||||||
for i := range nori.Animations {
|
for i := range nori.Animations {
|
||||||
a, err := nori.ExportAnimation(i)
|
a, err := nori.ExportAnimation(i)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -74,10 +75,11 @@ func writeApng(nori *Nori, name string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.WriteFile(fmt.Sprintf("./nori_test/%s.out/animation_%d.apng", name, i), out.Bytes(), 0740)
|
err = os.WriteFile(fmt.Sprintf("./nori_test/%s%s/animation_%d.apng", name, postfix, i), out.Bytes(), 0740)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
out.Reset()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 331 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 351 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 365 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 403 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 444 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 485 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 523 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 542 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 569 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 597 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 616 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 645 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 673 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 698 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 723 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 748 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 773 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 798 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 823 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 848 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 873 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 898 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 923 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 948 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 973 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 998 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 1023 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 25 KiB |