ENTS-Source / rocket-sheep

A bot running on tang.ents.ca to help with member actions.
GNU General Public License v3.0
9 stars 1 forks source link

Generate thumbnails for camera snapshots #41

Open turt2live opened 6 years ago

turt2live commented 6 years ago

Currently rocket sheep doesn't generate thumbnails for the snapshots, meaning people are asking for thumbnails on the file. To speed things up a little bit, rocket sheep should generate a thumbnail which it then appends to the event, speeding things up.

This does require two uploads, however.

Event for media with thumbnails:

{
  "origin_server_ts": 1516513982063,
  "sender": "@travis:t2l.io",
  "event_id": "$1516513982194wuyjR:t2l.io",
  "unsigned": {
    "age": 472,
    "transaction_id": "m1516513981836.39"
  },
  "content": {
    "info": {
      "mimetype": "image/png",
      "w": 1064,
      "h": 480,
      "size": 61353,
      "thumbnail_url": "mxc://t2l.io/gBnLfEySzvrRnyhUoalrZohg",
      "thumbnail_info": {
        "mimetype": "image/png",
        "w": 800,
        "h": 360,
        "size": 76813
      },
    },
    "body": "image.png",
    "msgtype": "m.image",
    "url": "mxc://t2l.io/uWyrYqXmOaGYLHuRmsDTwMrc"
  },
  "type": "m.room.message",
  "room_id": "!xCtFgpzrbRoyGdjkIM:dev.t2bot.io"
}