diff --git a/libraries/render-utils/src/TextureCache.cpp b/libraries/render-utils/src/TextureCache.cpp index 3bd05a14ee..4c9abc74a1 100644 --- a/libraries/render-utils/src/TextureCache.cpp +++ b/libraries/render-utils/src/TextureCache.cpp @@ -385,7 +385,9 @@ Texture::~Texture() { NetworkTexture::NetworkTexture(const QUrl& url, TextureType type, const QByteArray& content) : Resource(url, !content.isEmpty()), _type(type), - _translucent(false) { + _translucent(false), + _width(0), + _height(0) { if (!url.isValid()) { _loaded = true; @@ -532,6 +534,8 @@ void NetworkTexture::loadContent(const QByteArray& content) { void NetworkTexture::setImage(const QImage& image, bool translucent, const QColor& averageColor) { _translucent = translucent; _averageColor = averageColor; + _width = image.width(); + _height = image.height(); finishedLoading(true); imageLoaded(image); diff --git a/libraries/render-utils/src/TextureCache.h b/libraries/render-utils/src/TextureCache.h index 54c98a61cb..efcccc4b8c 100644 --- a/libraries/render-utils/src/TextureCache.h +++ b/libraries/render-utils/src/TextureCache.h @@ -150,6 +150,9 @@ public: /// Returns the lazily-computed average texture color. const QColor& getAverageColor() const { return _averageColor; } + int getWidth() const { return _width; } + int getHeight() const { return _height; } + protected: virtual void downloadFinished(QNetworkReply* reply); @@ -163,6 +166,8 @@ private: TextureType _type; bool _translucent; QColor _averageColor; + int _width; + int _height; }; /// Caches derived, dilated textures.