PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gif import ( "bytes" "compress/lzw" "image" "image/color" "image/color/palette" "io" "os" "reflect" "runtime" "runtime/debug" "strings" "testing" ) // header, palette and trailer are parts of a valid 2x1 GIF image. const ( headerStr = "GIF89a" + "\x02\x00\x01\x00" + // width=2, height=1 "\x80\x00\x00" // headerFields=(a color table of 2 pixels), backgroundIndex, aspect paletteStr = "\x10\x20\x30\x40\x50\x60" // the color table, also known as a palette trailerStr = "\x3b" ) // lzw.NewReader wants an io.ByteReader, this ensures we're compatible. var _ io.ByteReader = (*blockReader)(nil) // lzwEncode returns an LZW encoding (with 2-bit literals) of in. func lzwEncode(in []byte) []byte { b := &bytes.Buffer{} w := lzw.NewWriter(b, lzw.LSB, 2) if _, err := w.Write(in); err != nil { panic(err) } if err := w.Close(); err != nil { panic(err) } return b.Bytes() } func TestDecode(t *testing.T) { // extra contains superfluous bytes to inject into the GIF, either at the end // of an existing data sub-block (past the LZW End of Information code) or in // a separate data sub-block. The 0x02 values are arbitrary. const extra = "\x02\x02\x02\x02" testCases := []struct { nPix int // The number of pixels in the image data. // If non-zero, write this many extra bytes inside the data sub-block // containing the LZW end code. extraExisting int // If non-zero, write an extra block of this many bytes. extraSeparate int wantErr error }{ {0, 0, 0, errNotEnough}, {1, 0, 0, errNotEnough}, {2, 0, 0, nil}, // An extra data sub-block after the compressed section with 1 byte which we // silently skip. {2, 0, 1, nil}, // An extra data sub-block after the compressed section with 2 bytes. In // this case we complain that there is too much data. {2, 0, 2, errTooMuch}, // Too much pixel data. {3, 0, 0, errTooMuch}, // An extra byte after LZW data, but inside the same data sub-block. {2, 1, 0, nil}, // Two extra bytes after LZW data, but inside the same data sub-block. {2, 2, 0, nil}, // Extra data exists in the final sub-block with LZW data, AND there is // a bogus sub-block following. {2, 1, 1, errTooMuch}, } for _, tc := range testCases { b := &bytes.Buffer{} b.WriteString(headerStr) b.WriteString(paletteStr) // Write an image with bounds 2x1 but tc.nPix pixels. If tc.nPix != 2 // then this should result in an invalid GIF image. First, write a // magic 0x2c (image descriptor) byte, bounds=(0,0)-(2,1), a flags // byte, and 2-bit LZW literals. b.WriteString("\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02") if tc.nPix > 0 { enc := lzwEncode(make([]byte, tc.nPix)) if len(enc)+tc.extraExisting > 0xff { t.Errorf("nPix=%d, extraExisting=%d, extraSeparate=%d: compressed length %d is too large", tc.nPix, tc.extraExisting, tc.extraSeparate, len(enc)) continue } // Write the size of the data sub-block containing the LZW data. b.WriteByte(byte(len(enc) + tc.extraExisting)) // Write the LZW data. b.Write(enc) // Write extra bytes inside the same data sub-block where LZW data // ended. Each arbitrarily 0x02. b.WriteString(extra[:tc.extraExisting]) } if tc.extraSeparate > 0 { // Data sub-block size. This indicates how many extra bytes follow. b.WriteByte(byte(tc.extraSeparate)) b.WriteString(extra[:tc.extraSeparate]) } b.WriteByte(0x00) // An empty block signifies the end of the image data. b.WriteString(trailerStr) got, err := Decode(b) if err != tc.wantErr { t.Errorf("nPix=%d, extraExisting=%d, extraSeparate=%d\ngot %v\nwant %v", tc.nPix, tc.extraExisting, tc.extraSeparate, err, tc.wantErr) } if tc.wantErr != nil { continue } want := &image.Paletted{ Pix: []uint8{0, 0}, Stride: 2, Rect: image.Rect(0, 0, 2, 1), Palette: color.Palette{ color.RGBA{0x10, 0x20, 0x30, 0xff}, color.RGBA{0x40, 0x50, 0x60, 0xff}, }, } if !reflect.DeepEqual(got, want) { t.Errorf("nPix=%d, extraExisting=%d, extraSeparate=%d\ngot %v\nwant %v", tc.nPix, tc.extraExisting, tc.extraSeparate, got, want) } } } func TestTransparentIndex(t *testing.T) { b := &bytes.Buffer{} b.WriteString(headerStr) b.WriteString(paletteStr) for transparentIndex := 0; transparentIndex < 3; transparentIndex++ { if transparentIndex < 2 { // Write the graphic control for the transparent index. b.WriteString("\x21\xf9\x04\x01\x00\x00") b.WriteByte(byte(transparentIndex)) b.WriteByte(0) } // Write an image with bounds 2x1, as per TestDecode. b.WriteString("\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02") enc := lzwEncode([]byte{0x00, 0x00}) if len(enc) > 0xff { t.Fatalf("compressed length %d is too large", len(enc)) } b.WriteByte(byte(len(enc))) b.Write(enc) b.WriteByte(0x00) } b.WriteString(trailerStr) g, err := DecodeAll(b) if err != nil { t.Fatalf("DecodeAll: %v", err) } c0 := color.RGBA{paletteStr[0], paletteStr[1], paletteStr[2], 0xff} c1 := color.RGBA{paletteStr[3], paletteStr[4], paletteStr[5], 0xff} cz := color.RGBA{} wants := []color.Palette{ {cz, c1}, {c0, cz}, {c0, c1}, } if len(g.Image) != len(wants) { t.Fatalf("got %d images, want %d", len(g.Image), len(wants)) } for i, want := range wants { got := g.Image[i].Palette if !reflect.DeepEqual(got, want) { t.Errorf("palette #%d:\ngot %v\nwant %v", i, got, want) } } } // testGIF is a simple GIF that we can modify to test different scenarios. var testGIF = []byte{ 'G', 'I', 'F', '8', '9', 'a', 1, 0, 1, 0, // w=1, h=1 (6) 128, 0, 0, // headerFields, bg, aspect (10) 0, 0, 0, 1, 1, 1, // color table and graphics control (13) 0x21, 0xf9, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, // (19) // frame 1 (0,0 - 1,1) 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, // (32) 0x00, 0x02, 0x02, 0x4c, 0x01, 0x00, // lzw pixels // trailer 0x3b, } func try(t *testing.T, b []byte, want string) { _, err := DecodeAll(bytes.NewReader(b)) var got string if err != nil { got = err.Error() } if got != want { t.Fatalf("got %v, want %v", got, want) } } func TestBounds(t *testing.T) { // Make a local copy of testGIF. gif := make([]byte, len(testGIF)) copy(gif, testGIF) // Make the bounds too big, just by one. gif[32] = 2 want := "gif: frame bounds larger than image bounds" try(t, gif, want) // Make the bounds too small; does not trigger bounds // check, but now there's too much data. gif[32] = 0 want = "gif: too much image data" try(t, gif, want) gif[32] = 1 // Make the bounds really big, expect an error. want = "gif: frame bounds larger than image bounds" for i := 0; i < 4; i++ { gif[32+i] = 0xff } try(t, gif, want) } func TestNoPalette(t *testing.T) { b := &bytes.Buffer{} // Manufacture a GIF with no palette, so any pixel at all // will be invalid. b.WriteString(headerStr[:len(headerStr)-3]) b.WriteString("\x00\x00\x00") // No global palette. // Image descriptor: 2x1, no local palette, and 2-bit LZW literals. b.WriteString("\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02") // Encode the pixels: neither is in range, because there is no palette. enc := lzwEncode([]byte{0x00, 0x03}) b.WriteByte(byte(len(enc))) b.Write(enc) b.WriteByte(0x00) // An empty block signifies the end of the image data. b.WriteString(trailerStr) try(t, b.Bytes(), "gif: no color table") } func TestPixelOutsidePaletteRange(t *testing.T) { for _, pval := range []byte{0, 1, 2, 3} { b := &bytes.Buffer{} // Manufacture a GIF with a 2 color palette. b.WriteString(headerStr) b.WriteString(paletteStr) // Image descriptor: 2x1, no local palette, and 2-bit LZW literals. b.WriteString("\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02") // Encode the pixels; some pvals trigger the expected error. enc := lzwEncode([]byte{pval, pval}) b.WriteByte(byte(len(enc))) b.Write(enc) b.WriteByte(0x00) // An empty block signifies the end of the image data. b.WriteString(trailerStr) // No error expected, unless the pixels are beyond the 2 color palette. want := "" if pval >= 2 { want = "gif: invalid pixel value" } try(t, b.Bytes(), want) } } func TestTransparentPixelOutsidePaletteRange(t *testing.T) { b := &bytes.Buffer{} // Manufacture a GIF with a 2 color palette. b.WriteString(headerStr) b.WriteString(paletteStr) // Graphic Control Extension: transparency, transparent color index = 3. // // This index, 3, is out of range of the global palette and there is no // local palette in the subsequent image descriptor. This is an error // according to the spec, but Firefox and Google Chrome seem OK with this. // // See golang.org/issue/15059. b.WriteString("\x21\xf9\x04\x01\x00\x00\x03\x00") // Image descriptor: 2x1, no local palette, and 2-bit LZW literals. b.WriteString("\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02") // Encode the pixels. enc := lzwEncode([]byte{0x03, 0x03}) b.WriteByte(byte(len(enc))) b.Write(enc) b.WriteByte(0x00) // An empty block signifies the end of the image data. b.WriteString(trailerStr) try(t, b.Bytes(), "") } func TestLoopCount(t *testing.T) { testCases := []struct { name string data []byte loopCount int }{ { "loopcount-missing", []byte("GIF89a000\x00000" + ",0\x00\x00\x00\n\x00\n\x00\x80000000" + // image 0 descriptor & color table "\x02\b\xf01u\xb9\xfdal\x05\x00;"), // image 0 image data & trailer -1, }, { "loopcount-0", []byte("GIF89a000\x00000" + "!\xff\vNETSCAPE2.0\x03\x01\x00\x00\x00" + // loop count = 0 ",0\x00\x00\x00\n\x00\n\x00\x80000000" + // image 0 descriptor & color table "\x02\b\xf01u\xb9\xfdal\x05\x00" + // image 0 image data ",0\x00\x00\x00\n\x00\n\x00\x80000000" + // image 1 descriptor & color table "\x02\b\xf01u\xb9\xfdal\x05\x00;"), // image 1 image data & trailer 0, }, { "loopcount-1", []byte("GIF89a000\x00000" + "!\xff\vNETSCAPE2.0\x03\x01\x01\x00\x00" + // loop count = 1 ",0\x00\x00\x00\n\x00\n\x00\x80000000" + // image 0 descriptor & color table "\x02\b\xf01u\xb9\xfdal\x05\x00" + // image 0 image data ",0\x00\x00\x00\n\x00\n\x00\x80000000" + // image 1 descriptor & color table "\x02\b\xf01u\xb9\xfdal\x05\x00;"), // image 1 image data & trailer 1, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { img, err := DecodeAll(bytes.NewReader(tc.data)) if err != nil { t.Fatal("DecodeAll:", err) } w := new(bytes.Buffer) err = EncodeAll(w, img) if err != nil { t.Fatal("EncodeAll:", err) } img1, err := DecodeAll(w) if err != nil { t.Fatal("DecodeAll:", err) } if img.LoopCount != tc.loopCount { t.Errorf("loop count mismatch: %d vs %d", img.LoopCount, tc.loopCount) } if img.LoopCount != img1.LoopCount { t.Errorf("loop count failed round-trip: %d vs %d", img.LoopCount, img1.LoopCount) } }) } } func TestUnexpectedEOF(t *testing.T) { for i := len(testGIF) - 1; i >= 0; i-- { _, err := DecodeAll(bytes.NewReader(testGIF[:i])) if err == errNotEnough { continue } text := "" if err != nil { text = err.Error() } if !strings.HasPrefix(text, "gif:") || !strings.HasSuffix(text, ": unexpected EOF") { t.Errorf("Decode(testGIF[:%d]) = %v, want gif: ...: unexpected EOF", i, err) } } } // See golang.org/issue/22237 func TestDecodeMemoryConsumption(t *testing.T) { const frames = 3000 img := image.NewPaletted(image.Rectangle{Max: image.Point{1, 1}}, palette.WebSafe) hugeGIF := &GIF{ Image: make([]*image.Paletted, frames), Delay: make([]int, frames), Disposal: make([]byte, frames), } for i := 0; i < frames; i++ { hugeGIF.Image[i] = img hugeGIF.Delay[i] = 60 } buf := new(bytes.Buffer) if err := EncodeAll(buf, hugeGIF); err != nil { t.Fatal("EncodeAll:", err) } s0, s1 := new(runtime.MemStats), new(runtime.MemStats) runtime.GC() defer debug.SetGCPercent(debug.SetGCPercent(5)) runtime.ReadMemStats(s0) if _, err := Decode(buf); err != nil { t.Fatal("Decode:", err) } runtime.ReadMemStats(s1) if heapDiff := int64(s1.HeapAlloc - s0.HeapAlloc); heapDiff > 30<<20 { t.Fatalf("Decode of %d frames increased heap by %dMB", frames, heapDiff>>20) } } func BenchmarkDecode(b *testing.B) { data, err := os.ReadFile("../testdata/video-001.gif") if err != nil { b.Fatal(err) } cfg, err := DecodeConfig(bytes.NewReader(data)) if err != nil { b.Fatal(err) } b.SetBytes(int64(cfg.Width * cfg.Height)) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { Decode(bytes.NewReader(data)) } }