OKAY so if I copy-paste out of my image editor, like this, I get a PNG.
(better than a BMP, at least, and it makes sense for screenshots)
but if I copy a jpeg file in explorer, it pastes as a jpeg.

so here's my idea: I write a little script that yanks the PNG out of the clipboard, saves it as a JPEG to a temp folder, then copies that jpeg file. So instead of directly posting out of my image editor, I do copy, click the script icon, then paste.

that'd be only a minor change to my workflow, it'd fix the PNG problem, and it wouldn't be too hard to write, I don't think.

basically I'm trying to avoid the problem of posting giant PNGs when they'd be better served as a small JPEG. Twitter doesn't care what you post, it will JPEG them if it feels like it, and I have been unintentionally depending on that functionality

Follow

@foone you might be able to create a userscript for the fedi frontend that you use which grabs the PNG, dumps it into an html canvas, and then exports it as a jpeg, then replaces the file in the file input element with the jpeg. Like a greasemonkey script.

I did this pattern in my own app once, looking back at the code git.sequentialread.com/forest/

I think I ended up nixing the client side conversion to jpeg because it didn't work properly in every browser. Image rotation issues on iOS probably related to apples proprietary photo format :garfield:

@foone developer.mozilla.org/en-US/do. I think this might make a DOM blob instead of a huge string? Or maybe there's a different method that does that, I don't remember and I can't find the old code from my phone rn

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.