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

Function convertImageToWebP

helpers.go:842–853  ·  view source on GitHub ↗
(input []byte)

Source from the content-addressed store, hash-verified

840 if err != nil {
841 return nil
842 }
843
844 // WhatsApp sticker EXIF header structure
845 header := []byte{
846 0x49, 0x49, 0x2A, 0x00, // TIFF little-endian marker
847 0x08, 0x00, 0x00, 0x00, // IFD offset
848 0x01, 0x00, // Number of directory entries
849 0x41, 0x57, // Tag ID (WhatsApp custom)
850 0x07, 0x00, // Data type (undefined)
851 }
852 footer := []byte{0x16, 0x00, 0x00, 0x00} // Next IFD offset
853
854 var buf bytes.Buffer
855 buf.Write(header)
856 binary.Write(&buf, binary.LittleEndian, uint32(len(jsonBytes)))

Callers 1

convertToWebPStickerFunction · 0.85

Calls 1

runFFmpegConversionFunction · 0.85

Tested by

no test coverage detected