>>2817595>>2818121Just use the JPEGView fork
It even warns you that lossless JPEG transformation only works if the resolution is divisible by 8 and it'll trim a little otherwise
As a bonus, JPEGView is a really quick and minimalist image viewer with JPEG XL support
https://github.com/sylikc/jpegview/releases