Can embed any file in a PNG/WebM/GIF/JPEG and upload it to a third-party host through 4chan
Go to file
2022-01-04 17:17:22 +01:00
src Fix settings button :^) 2022-01-04 17:17:22 +01:00
.eslintignore Tentative webm embedding support 2022-01-01 19:52:50 +01:00
.eslintrc.cjs streaming performance 2022-01-04 16:36:43 +01:00
.gitignore Enable processing of all posts in thread 2021-12-22 21:09:05 +01:00
build.js Do updating properly 2022-01-02 16:41:02 +01:00
esbuild.inject.js build 2022-01-01 22:27:51 +01:00
eye.png more illust 2021-12-24 06:41:30 +01:00
main.d.ts streaming performance 2022-01-04 16:36:43 +01:00
main.meta.js Fix settings button :^) 2022-01-04 17:17:22 +01:00
main.user.js Fix settings button :^) 2022-01-04 17:17:22 +01:00
package-lock.json forgot build system... 2022-01-02 14:51:46 +01:00
package.json forgot build system... 2022-01-02 14:51:46 +01:00
README.md streaming performance 2022-01-04 16:36:43 +01:00
screen.png Add how to 2021-12-24 06:39:55 +01:00
tsconfig.json forgot build system... 2022-01-02 14:51:46 +01:00

PNG Extra Embedder (PEE)

Can embed any file in a PNG/WebM/GIF and upload it through 4chanX. Requires 4chanX and violentmonkey.

How to Build

npm i and npm run build then install the generated main.users.js

How to Install

Or use the prebuilt main.user.js at the root of this repo.

How to use

Posts with an embedded image/video will have an eye icon next to it. Clicking the icon reveal the content. eye

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

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:

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
  • 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

  • fails to find files in new posts after a thread update
  • more to come