fix export_to_png with img_sdl2
Merge pull request #2680 from kived/sdl2-exportpng

fix export_to_png with img_sdl2