Skip to content

Instantly share code, notes, and snippets.

@krypton-byte
Created January 6, 2021 16:54
Show Gist options
  • Select an option

  • Save krypton-byte/2fe124d9acfb6c418948ea1b2113d877 to your computer and use it in GitHub Desktop.

Select an option

Save krypton-byte/2fe124d9acfb6c418948ea1b2113d877 to your computer and use it in GitHub Desktop.
# create: Krypton-byte
# Python Version
def stickerExif(stickerPackID, packname, author, googlelink, applelink):
code = [0x00,0x00,0x16,0x00,0x00,0x00]
exif = {"sticker-pack-id": stickerPackID,"sticker-pack-name": packname,"sticker-pack-publisher": author,"android-app-store-link": googlelink,"ios-app-store-link": applelink}
if (length:=exif.__str__().__len__()) > 256:
length -=256
code.insert(0, 0x01)
else:
code.insert(0, 0x00)
return bytes([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00])+bytes([int("0x0"+hex(length)[2:].__str__() if length < 16 else hex(length)[2:].__str__(), 16)])+bytes(code)+exif.__str__().encode()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment