<span class="mw-page-title-main">EVE</span>
Fabrice P. Lauss𝕪's Web

EVE

EVE (Extract→Verify→Embark) is my facility to quickly import pictures to my web. It takes whatever image is on the clipboard and puts it on the local wiki: right-click an image in Chrome and « Copy image », press Ctrl+Alt+I, and it lands as lw-YYYYMMDD-HHMMSS.jpg, never bigger than 800 kB, with the line that displays it waiting on the clipboard.

She is named after the probe of WALL-E, who scans, finds the specimen, seals it inside herself and carries it back up to the ship. She keeps the company of M-O, who tidies what she brings, and of dates2wiki and TeX2unicode, who also live on a keystroke.

Written with Claude Opus 5 on 11 August (2026) for KDE Plasma 6 on X11. Version 1.0.

What she picks up

Where it comes from What is on the clipboard What she does with it
Chrome, « Copy image » the bitmap, as image/png the ordinary case
Chrome, « Copy image address » a bare http(s) URL she fetches it, and the URL is written on the File: page as its source
Spectacle, GIMP, Krita the bitmap the same as Chrome
Dolphin, Ctrl+C on a file text/uri-list several files at once become lw-…-1, lw-…-2, …
Dolphin, right-click the files themselves « Send to laussywiki (EVE) » in the context menu

The 800 kB budget

Quality is spent first and pixels only afterwards, which is the right order. If the image is already under budget and is a plain JPEG, its bytes go up untouched: re-encoding a file that is already small enough only loses a generation for nothing. Otherwise she binary-searches the JPEG quality between 40 and 95 for the highest one that still fits, and only when even quality 40 is too fat does she begin to scale the image down—by 0.85, then 0.72, then 0.6…—searching the quality again at each step.

A screenshot or a diagram (an alpha channel, or fewer than 4096 distinct colours) goes up as PNG instead, because JPEG turns crisp text into mush. If no PNG fits the budget she falls back to JPEG and says so rather than doing it quietly.

What went in What came out
a 4000×3000 photograph, 12.1 MB 1843×1382 at quality 61, 791 kB
a 900×675 photograph, 348 kB not touched at all—it was already under the ceiling
a 1400×900 screenshot of code PNG, 100 kB, every letter still sharp

Nothing is ever re-encoded above 2560 px: no page here shows more, and the search costs a quarter as much once the pixels are capped.

When she asks

Never, when the answer is obvious—under budget, or squeezed at a quality she is not embarrassed by. She pops up only on doubt: a heavy squeeze (below quality 72), a downscale, line art that has to become JPEG after all, a name already taken, an image fetched from a URL. The dialog shows a preview, the name, the format, a quality slider with the resulting size updating as it moves, a width, and a tooltip box; Enter uploads, Esc cancels. Ctrl+Alt+Shift+I asks always, --quiet never asks.

What lands on the clipboard

<center><wz tip="">[[File:lw-20260811-153045.jpg|400px]]</wz></center>

Whatever is typed in the dialog's tooltip box becomes the tip="", since that line has no thumb caption to hold it. Note that an empty tooltip is exactly what M-O sweeps away: leave the box blank and the next M-O run will strip the &lt;wz&gt; pair and leave the centred image behind, which is the right outcome but a surprising one if unexpected.

Usage

EVE                     # whatever is on the clipboard — what Ctrl+Alt+I does
EVE --ask               # always show the dialog (Ctrl+Alt+Shift+I)
EVE --quiet             # never show it
EVE shot.png photo.jpg  # files instead of the clipboard
EVE --caption 'text'    # fill the tooltip without the dialog
EVE --px 750            # another width in the pasted line
EVE --budget 400        # another ceiling, in kB
EVE --dry-run           # say what the squeeze would do, and touch nothing
EVE --stash             # upload to the file stash: everything is exercised,
                        # nothing is published

Notes

  • Python with Pillow, and nothing to install beyond xclip. The script is ~/bin/EVE; the shortcuts are ~/.local/share/applications/net.local.eve.desktop and its -ask twin, declared in ~/.config/kglobalshortcutsrc the same way as dates2wiki; the right-click entry is ~/.local/share/kio/servicemenus/eve-upload.desktop. The ceiling, the width and the paste behaviour are set in ~/.config/eve.conf.
  • She writes to the local wiki only, never to laussy.org directly. llw2lw re-uploads local files byte-exact, so what she brings aboard rides online on the next sync.
  • --stash is the way to test her: MediaWiki's file stash exercises the login, the token and the multipart upload, but creates no File: page. Testing by uploading and deleting leaves a log entry behind; the stash leaves nothing.
  • With paste = yes in the configuration she does not merely fill the clipboard but pastes into the window that was focused when the shortcut was struck. That keystroke is synthesised with explicit hardware keycodes, never with xdotool, which rewrites the keymap and wrecks a multiple-layout keyboard—and she waits for Ctrl+Alt to come back up before injecting anything.
  • MediaWiki capitalises the first letter of a title, so lw-20260811-153045.jpg is stored as Lw-20260811-153045.jpg. Links written either way find it.