Skip to content
Snippets Groups Projects
Commit ff65d4a0 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix thumbnail size request

Can't use 0 size or negatives, so use the maximum positive value, when
one diemension is invalid.
parent 8ba00fd9
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,8 @@ void MXCImageResponse::run() {
mtx::http::ThumbOpts opts;
opts.mxc_url = "mxc://" + m_id.toStdString();
opts.width = m_requestedSize.width();
opts.height = m_requestedSize.height();
opts.width = m_requestedSize.width() > 0 ? m_requestedSize.width() : -1;
opts.height = m_requestedSize.height() > 0 ? m_requestedSize.height() : -1;
opts.method = "scale";
http::client().get_thumbnail(opts, [this, cacheFile](const std::string &res, mtx::http::RequestErr err) {
if (err) {
......
#pragma once
#include <mtx.hpp>
#include <mtxclient/http/client.hpp>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment