MCPcopy Create free account
hub / github.com/asternic/wuzapi / processStickerData

Function processStickerData

helpers.go:855–875  ·  view source on GitHub ↗
(stickerData string, mimeOverride string, packID, packName, packPublisher string, emojis []string)

Source from the content-addressed store, hash-verified

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
863func isValidWebP(data []byte) bool {
864 return len(data) >= riffHeaderSize &&
865 string(data[0:4]) == "RIFF" &&
866 string(data[8:12]) == "WEBP"
867}
868
869func 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

Callers 1

SendStickerMethod · 0.85

Calls 2

convertToWebPStickerFunction · 0.85
embedStickerEXIFFunction · 0.85

Tested by

no test coverage detected