Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Gregory
@grishka@mastodon.social  ·  activity timestamp yesterday

I added support for displaying blurhashes as image placeholders in #Smithereen on the web. In what is probably the most cursed way possible. It turns out every browser supports the BMP file format, which is just a simple header followed by the raw pixel data. So, here's what I did:

Sorry, no caption provided by author
Sorry, no caption provided by author
Sorry, no caption provided by author
  • Copy link
  • Flag this post
  • Block
iliazeus
@iliazeus@gts.iliazeus.lol replied  ·  activity timestamp 2 hours ago

@grishka BMP also has some row alignment requirements iirc. Don't know if it's relevant for blurhash images though.

  • Copy link
  • Flag this comment
  • Block
mittorn
@mittorn@masturbated.one replied  ·  activity timestamp yesterday

@grishka
when i moved vk bot to new server, i rewrited quote image generation to work without extra dependencies:
https://github.com/mittorn/yanina.bot/blob/new_commands/modules/quote.py#L2873
so it just writes bmp header to file stream

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login