Hiding warnings about corrupt image files

When I run a wxPython app (written by me) from the Windows (10) command line (DOS box), executing
wx.Image( )
for certain files causes a message to appear (underneath the command line that invoked the app) e.g.

Corrupt JPEG data: 38 extraneous bytes before marker 0xd9

but the image appears to be displayed OK.
I would like a way of suppressing these messages.
They appear to be output with quite a low-level mechanism, specifically
not via sys.stdout or sys.stderr
not via the wx logging mechanism.
They are output with a final newline, so it is not possible to hide them by outputting backspaces, '\r’s, spaces etc.
As far as I know this has always been true whatever the version of wxPython / Python / Windows.
Is this possible?
Thanks

I had a similar issue. I used Gimp to open and then save the image. The error went away.

Johnf

That’ll only work for images known beforehand. Or else one
could implement an extremely kludgy workaround by os.popen(opening/saving)
images before loading them …

Karsten

Maybe I mis-read the post. But that is what I took away from the post - that they were trying to open a jpeg image. Which lead me to believe that the image was in fact corrupt.

Correct, the .JPEG file was corrupt but not so corrupt that it
couldn’t be read by wx.Image() and displayed.
I would like to hide the message, that’s all.
Rob Cliffe