Skip to content

Commit

Permalink
Add support for jpg compression format (backport #142) (#159)
Browse files Browse the repository at this point in the history
* Add support for jpg compression format (backport #142)

* Fix formatting

---------

Co-authored-by: Tina Tian <31605482+Te12944265-AMAHA@users.noreply.github.com>
  • Loading branch information
bjsowa and Te12944265-AMAHA authored Oct 3, 2024
1 parent 140ff53 commit 375fd06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ros_compressed_streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 375fd06

Please sign in to comment.