Done!
a 3-byte Byte-Order-Mark (
BOM) was passed through to the output of the generated image preview file.
theoretically, it could have been my connector.php containing this 3 extra bytes of BOM. But it wasn’t. It took me a while to go through all the files that might interfere here, and I finally found it:
MODX’s
config.inc.php in /manager/includes/ started with a UTF-8 BOM. I had to open it with a
hex-editor to see them (EF BB BF). I removed them by changing the encoding from "UTF-8 with signature" to "UTF-8" using
Notepad2 (
notepad++ or sth similar should also work).
the 3-bytes of BOM from the config.inc.php probably were also output on every html-page, but went unnoticed there.
it works now, after 3 months of troubleshooting, 3 extra bytes were the culprits.