From f5b891ae3cdd012ab5b64216054e9f5a29dfc37e Mon Sep 17 00:00:00 2001 From: Tina Tian <31605482+Te12944265-AMAHA@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:52:47 -0400 Subject: [PATCH] Add support for jpg compression format (backport #142) --- src/ros_compressed_streamer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ros_compressed_streamer.cpp b/src/ros_compressed_streamer.cpp index 9b6fefc..1662bc7 100644 --- a/src/ros_compressed_streamer.cpp +++ b/src/ros_compressed_streamer.cpp @@ -62,7 +62,9 @@ void RosCompressedStreamer::sendImage( { try { std::string content_type; - if (msg->format.find("jpeg") != std::string::npos) { + if(msg->format.find("jpeg") != std::string::npos || + msg->format.find("jpg") != std::string::npos) + { content_type = "image/jpeg"; } else if (msg->format.find("png") != std::string::npos) { content_type = "image/png";