add a maximum RAM usage for images

This commit is contained in:
fourtf
2021-06-24 22:54:36 +02:00
parent 97b9bfb2bd
commit ed6ef0b98e
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -50,6 +50,9 @@ using ImagePtr = std::shared_ptr<Image>;
class Image : public std::enable_shared_from_this<Image>, boost::noncopyable
{
public:
// Maximum amount of RAM used by the image in bytes.
static constexpr int maxBytesRam = 20 * 1024 * 1024;
~Image();
static ImagePtr fromUrl(const Url &url, qreal scale = 1);