(stickerData string, mimeOverride string, packID, packName, packPublisher string, emojis []string)
| 853 | |
| 854 | var buf bytes.Buffer |
| 855 | buf.Write(header) |
| 856 | binary.Write(&buf, binary.LittleEndian, uint32(len(jsonBytes))) |
| 857 | buf.Write(footer) |
| 858 | buf.Write(jsonBytes) |
| 859 | |
| 860 | return buf.Bytes() |
| 861 | } |
| 862 | |
| 863 | func isValidWebP(data []byte) bool { |
| 864 | return len(data) >= riffHeaderSize && |
| 865 | string(data[0:4]) == "RIFF" && |
| 866 | string(data[8:12]) == "WEBP" |
| 867 | } |
| 868 | |
| 869 | func createVP8XChunk(width, height int) []byte { |
| 870 | chunk := make([]byte, vp8xChunkSize) |
| 871 | copy(chunk[0:4], "VP8X") |
| 872 | binary.LittleEndian.PutUint32(chunk[4:8], vp8xPayloadSize) |
| 873 | chunk[vp8xFlagsOffset] = vp8xFlagEXIF |
| 874 | putUint24LE(chunk[vp8xWidthOffset:], width-1) |
| 875 | putUint24LE(chunk[vp8xHeightOffset:], height-1) |
| 876 | return chunk |
| 877 | } |
| 878 |
no test coverage detected