~michihenning/thumbnailer/no-tmp-file

« back to all changes in this revision

Viewing changes to include/unity/thumbnailer/qt/thumbnailer-qt.h

  • Committer: Tarmac
  • Author(s): Michi Henning
  • Date: 2015-11-13 07:36:39 UTC
  • mfrom: (299.1.2 adjust-zero-dimension)
  • Revision ID: tarmac-20151113073639-4imdml3xqog47rpd
Fixed incorrect scaling of thumbnails with dimensions (w,0) or (0,h). Fixes: https://bugs.launchpad.net/bugs/1515848.

Approved by PS Jenkins bot, James Henstridge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
 
140
140
The requested size for a thumbnail specifies a bounding box (in pixels) of type `QSize` to which
141
141
the thumbnail will be scaled.
142
 
(The aspect ratio of the original image is preserved.) Passing `QSize(0,`<i>n</i>`)` or `QSize(`<i>n</i>`,0)`
143
 
defines a square bounding box of <i>n</i> pixels.
144
 
Sizes with one or both dimensions &lt;&nbsp;0 return an error.
145
 
Sizes with one or both dimensions &ge;&nbsp;<B>max-thumbnail-size</B> (usually 1920) are clamped to
146
 
<B>max-thumbnail-size</B> pixels (see <B>thumbnailer-settings</B>(7)).
 
142
(The aspect ratio of the original image is preserved.)
 
143
 
 
144
The returned thumbnails never exceed <B>max-thumbnail-size</B> (usually 1920, see <B>thumbnailer-settings</B>(7))
 
145
in their larger dimension, even if a larger size is requested.
 
146
 
 
147
- Passing `QSize(0,`<i>n</i>`)` or `QSize(`<i>n</i>`,0)` defines a bounding box of <i>n</i> pixels
 
148
in one dimension, and unconstrained size in the other dimension (subject to the <B>max-thumbnail-size</B>
 
149
limit).
 
150
- Passing `QSize(0,0)` requests a thumbnail that fits into a square bounding box of <B>max-thumbnail-size</B>.
 
151
- Sizes with one or both dimensions &ge;&nbsp;<B>max-thumbnail-size</B>) are clamped to
 
152
<B>max-thumbnail-size</B> pixels.
 
153
- Sizes with one or both dimensions &lt;&nbsp;0 return an error.
147
154
 
148
155
Original images are never scaled up, so the returned thumbnail may be smaller than its requested size.
149
156