PEE/README.md

57 lines
1.9 KiB
Markdown
Raw Normal View History

2021-12-22 20:05:17 +00:00
PNG Extra Embedder (PEE)
========================
2022-01-01 21:02:42 +00:00
Can embed any file in a PNG/WebM and upload it through 4chanX.
2021-12-23 01:19:58 +00:00
Requires 4chanX and violentmonkey.
2021-12-22 20:05:17 +00:00
How to Build
============
npm i and npm run build
2021-12-24 05:13:22 +00:00
then install the generated main.users.js
2021-12-22 20:05:17 +00:00
How to Install
==============
2021-12-23 01:19:58 +00:00
Or use the prebuilt main.user.js at the root of this repo.
2021-12-24 05:39:55 +00:00
How to use
==========
Posts with an embedded image/video will have an eye icon next to it.
Clicking the icon reveal the content.
2021-12-24 05:41:30 +00:00
![eye](eye.png)
2021-12-24 05:39:55 +00:00
In the quick reply form, a magnet icon will appear.
You need to select a png file to upload first, as you would normally (this is what the file will appear as), then click on the magnet to select a file to embed.
![qr](screen.png)
Format
======
This works by appending the file in the last IDAT chunk.
Metadata information is stored in a tEXt chunk, placed near the header so that a parser looking for that embedded information can bail out without having to parse the whole file.
Metadata in the tEXt has the following meaning:
2021-12-24 05:26:49 +00:00
CUM[null]0 -> The last IDAT chunk is formatted as [filename length[LE 4 bytes], filename, filedata]
CUM[null]X is reserved for future extensions
Possible workaround for 4chan jannies would be to assoome IDAT chunks don't go over a certain size, slightly harder workaround would be to check if the deflate stream yields enough pixels to fit the described dimensions of the image.
Other formats
=============
The format used by Zip anon won't be supported because:
- it isn't extensible (if change were to the storage format, an extension update wouldn't be backcompatible)
- requires parsing the whole file to know if it has an embedded file
2022-01-01 21:02:42 +00:00
- and includes a private chunk type that is functionally defective (stores the length of the last IDAT chunk as a mean to identify it, instead of assooming it's simply the last one)
Bugs
====
- Cannot expand a file that was embedded in a post that was inlined.
2022-01-01 22:49:13 +00:00
- fails to find files in new posts after a thread update
2022-01-01 21:02:42 +00:00
- more to come