Skip to content

Commit 6044298

Browse files
committedDec 5, 2018
Add dox comment, fix travis
1 parent ad4b876 commit 6044298

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed
 

‎python/core/auto_generated/qgsimagecache.sip.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ size, and then the result cached for subsequent lookups.
4444
``path`` may be a local file, remote (HTTP) url, or a base 64 encoded string (with a "base64:" prefix).
4545

4646
The ``size`` parameter dictates the target size of the image. An invalid size indicates the
47-
original raster image size (with no resampling).
47+
original raster image size (with no resampling). A size in which the width or height is
48+
set to zero will have the zeroed value automatically computed when keepAspectRatio is true.
4849

4950
If ``keepAspectRatio`` is true, then the original raster aspect ratio will be maintained during
5051
any resampling operations.

‎src/core/qgsimagecache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ class CORE_EXPORT QgsImageCache : public QgsAbstractContentCache< QgsImageCacheE
106106
* \a path may be a local file, remote (HTTP) url, or a base 64 encoded string (with a "base64:" prefix).
107107
*
108108
* The \a size parameter dictates the target size of the image. An invalid size indicates the
109-
* original raster image size (with no resampling).
109+
* original raster image size (with no resampling). A size in which the width or height is
110+
* set to zero will have the zeroed value automatically computed when keepAspectRatio is true.
110111
*
111112
* If \a keepAspectRatio is true, then the original raster aspect ratio will be maintained during
112113
* any resampling operations.

‎tests/src/python/test_qgsimagecache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def testRemoteImage(self):
7777
image, in_cache = QgsApplication.imageCache().pathAsImage(url, QSize(100, 100), 1.0, True)
7878

7979
self.assertTrue(self.imageCheck('Remote Image', 'remote_image', image))
80-
self.assertEqual(QgsApplication.imageCache().originalSize(url), QSize(511, 800))
80+
self.assertEqual(QgsApplication.imageCache().originalSize(url), QSize(511, 800), 1.0)
8181

8282
def testRemoteImageMissing(self):
8383
"""Test fetching remote image with bad url"""
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.