Dafang-Hacks / Main

138 stars 63 forks source link

Fixed buffer copying issue with in-memory JPEG #26

Closed puddly closed 6 years ago

puddly commented 6 years ago

The actual size of the dumped JPEG image is ignored when it is moved into shared memory and instead the entire 2MB buffer is copied (for 1080p images), which includes about 1.8MB of trailing garbage.

I'm able to reliably read a 1080p JPEG via the /cgi-bin/currentpic.cgi endpoint more than 5 times a second now, so you can probably decrease the refresh interval of the web UI preview image from 4 seconds to maybe 0.9 seconds.

nik0 commented 6 years ago

Great ! Thanks good catch