From 0f91510a766a3ac3c8bf0e7708e8998c2b41d260 Mon Sep 17 00:00:00 2001 From: xIronic Date: Sun, 23 Feb 2025 22:05:39 +0100 Subject: [PATCH] removed unnecessary filetype checks --- libsrc/api/JsonAPI.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index 05138df3..80828c84 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -406,16 +406,6 @@ void JsonAPI::handleGetImageSnapshotCommand(const QJsonObject &message, const Js QString replyMsg; QString filetype = message["filetype"].toString(); const QStringList fileTypes{"BMP", "JPG", "PNG"}; - if (filetype.isEmpty()) - { - sendErrorReply("Missing filetype. Available filetypes: " + fileTypes.join(", "), cmd); - return; - } - else if (!fileTypes.contains(filetype, Qt::CaseInsensitive)) - { - sendErrorReply("Invalid filetype. Available filetypes: " + fileTypes.join(", "), cmd); - return; - } const PriorityMuxer::InputInfo priorityInfo = _hyperion->getPriorityInfo(_hyperion->getCurrentPriority()); Image image = priorityInfo.image; QImage snapshot(reinterpret_cast(image.memptr()), image.width(), image.height(), qsizetype(3) * image.width(), QImage::Format_RGB888);