Giter Site home page Giter Site logo

luckyturtledev / mstickereditor Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 3.0 302 KB

import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix

License: Apache License 2.0

Rust 99.67% Shell 0.33%
maunium-stickerpicker matrix sticker stickerpicker rust

mstickereditor's Introduction

mstickereditor's People

Contributors

esmailelbobdev2 avatar linyinfeng avatar luckyturtledev avatar msrd0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mstickereditor's Issues

`database::Hash` cannot be used as a map key

Consider wrapping it in a newtype struct like this:

#[derive(Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
#[serde(transparent)]
pub struct MediaHash(
	#[serde(with = "serde_big_array::BigArray")] pub database::Hash
);

matrix: stream error received: unspecific protocol error detected

import of some stickerpacks fail:

 ERROR failed to import sticker 2 from pack "TheLittleMole"

Caused by:
    0: error sending request for url (https://matrix-client.matrix.org/_matrix/media/r0/upload?access_token=TOKEN&filename=stickers%2Ffile_3643.webp): http2 error: stream error received: unspecific protocol error detected
    1: http2 error: stream error received: unspecific protocol error detected
    2: stream error received: unspecific protocol error detected
 ERROR failed to import sticker 7 from pack "TheLittleMole"

packs: https://t.me/addstickers/TheLittleMole, https://t.me/addstickers/ArcticFox

Stickers don't show up on Element desktop

Animated stickers don't show up on github page too, but somehow work just fine on SchildiChat on Android. I previously used sticker picker to import Telegram sticker packs. After using mstickereditor I changed index.json and added other json files.

Am I doing something wrong?

use feature flags

Since this project depends on more and more c libs.
It should be a good idea to split functionality into feature, to build a version with basic functionality easy.

improve doc

  • how to get the bot token?
  • reminder to create/update the index
  • how to enable the widget?
  • how to setup action/clone (link to maunium doc)
  • add fluffy chat
  • add --help output to readme

import of some webm sticker fails

For example at the sticker pack https://t.me/addstickers/LANI_Kurumi_chan_2_ENG the import of the following stickers does fail:

 ERROR failed to import sticker 0 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 708608) bytes as input buffer, got 720896 bytes
 ERROR failed to import sticker 2 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 679936) bytes as input buffer, got 688128 bytes
 ERROR failed to import sticker 6 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 724992) bytes as input buffer, got 737280 bytes
 ERROR failed to import sticker 12 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 712704) bytes as input buffer, got 720896 bytes
 ERROR failed to import sticker 13 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 667648) bytes as input buffer, got 671744 bytes
 ERROR failed to import sticker 15 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 745472) bytes as input buffer, got 753664 bytes
 ERROR failed to import sticker 16 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 712704) bytes as input buffer, got 720896 bytes
 ERROR failed to import sticker 17 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 782336) bytes as input buffer, got 786432 bytes
 ERROR failed to import sticker 18 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 839680) bytes as input buffer, got 851968 bytes
 ERROR failed to import sticker 19 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 913408) bytes as input buffer, got 917504 bytes
 ERROR failed to import sticker 28 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 1040384) bytes as input buffer, got 1048576 bytes
 ERROR failed to import sticker 42 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 925696) bytes as input buffer, got 933888 bytes
 ERROR failed to import sticker 43 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 1003520) bytes as input buffer, got 1015808 bytes
 ERROR failed to import sticker 47 from pack "LANI_Kurumi_chan_2_ENG"

Caused by:
    BufferSizeFailed: Expected (width * height * 4 = 757760) bytes as input buffer, got 770048 bytes

@msrd0

sticker is not shown at matrix

I tried it and compiled it but my stickers are not working (?) The media files appear to be there but nothing is showing, not even in Element. image

https://0x416c69.github.io/stickerpicker/web/#pack-tg_name_MyQuby (latest pack)

My synapse server is up to date. Is it required to enable dynamic_thumbnails in synapse for this to work? When trying to fetch those webp images, I'm getting this error 400:

{"errcode":"M_UNKNOWN","error":"Cannot find any thumbnails for the requested media ([b'ag5.ir', b'qAsAxJsWpWXAlGaJaeZrJwQC']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.)"}

Pack: https://t.me/addstickers/MyQuby


issue by @0x416c69 imported from maunium/stickerpicker#63 (comment)

How to run mstickereditor?

I'm sorry for the stupid question, but I can't run it. How to use it? If I just run 'mstickereditor' terminal it won't work.
I use Garuda linux. I pre-installed sticker-picker.

compress stickers

sticker should be compressed, before uploaded to matrix.
For example pngs can be compressed with oxipng.

Todo:

  • png
  • webm

Failed to build with ffmpeg 6.1

The dependency ffmpeg-next locked in Cargo.lock does not support FFmpeg 6.1, causing a build failure.

error[E0004]: non-exhaustive patterns: `sys::AVPixelFormat::AV_PIX_FMT_P212BE`, `sys::AVPixelFormat::AV_PIX_FMT_P212LE`, `sys::AVPixelFormat::AV_PIX_FMT_P412BE` and 3 more not covered
[[package]]
name = "ffmpeg-next"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8af03c47ad26832ab3aabc4cdbf210af3d3b878783edd5a7ba044ba33aab7a60"
dependencies = [
 "bitflags 1.3.2",
 "ffmpeg-sys-next",
 "libc",
]

Upstream of ffmpeg-next already fixed this issue in https://github.com/zmwangx/rust-ffmpeg-sys/pull/65, and released the fix on crates.io (https://crates.io/crates/ffmpeg-next/versions).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.