RobotWebTools / web_video_server

HTTP Streaming of ROS Image Topics in Multiple Formats
http://ros.org/wiki/web_video_server
Other
269 stars 187 forks source link

Accept `jpg` format for `ros_compressed` #139

Open amalnanavati opened 10 months ago

amalnanavati commented 10 months ago

The ros_compressed format requires the message's format field to be exactly "jpeg" (code here). However, the formats "jpeg" and "jpg" are equivalent, and some ROS libraries (e.g., cv_bridge) output compressed images with the format field set to "jpg" by default. Therefore, to improve usability for users who need to use web_video_server with compressed images outputted by cv_bridge, I think web_video_server should also accept the "jpg" format.

Suggested fix: Over here add an additional check for the "jpg" format, setting the content type to "image/jpeg" in that case.