Merge lp:~lfroen/stellarium/stellarium-iphone into lp:stellarium

Proposed by Froenchenko Leonid
Status: Merged
Approved by: Fabien Chéreau
Approved revision: 4742
Merged at revision: 4742
Proposed branch: lp:~lfroen/stellarium/stellarium-iphone
Merge into: lp:stellarium
Diff against target: 32 lines (+13/-8)
1 file modified
src/core/StelTexture.cpp (+13/-8)
To merge this branch: bzr merge lp:~lfroen/stellarium/stellarium-iphone
Reviewer Review Type Date Requested Status
Fabien Chéreau Pending
Review via email: mp+32667@code.launchpad.net

Description of the change

If texture image already loaded, use it to determine texture size.

To post a comment you must log in.
Revision history for this message
Fabien Chéreau (xalioth) wrote :

ok.

Revision history for this message
Fabien Chéreau (xalioth) wrote :

Merged + fixed a bit style.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/StelTexture.cpp'
2--- src/core/StelTexture.cpp 2010-04-15 13:54:32 +0000
3+++ src/core/StelTexture.cpp 2010-08-14 15:35:52 +0000
4@@ -195,15 +195,20 @@
5 {
6 if (width<0 || height<0)
7 {
8- // Try to get the size from the file without loading data
9- QImageReader im(fullPath);
10- if (!im.canRead())
11- {
12- return false;
13+ if ( !qImage.isNull() ) {
14+ width = qImage.width();
15+ height = qImage.height();
16+ } else {
17+ // Try to get the size from the file without loading data
18+ QImageReader im(fullPath);
19+ if (!im.canRead())
20+ {
21+ return false;
22+ }
23+ QSize size = im.size();
24+ width = size.width();
25+ height = size.height();
26 }
27- QSize size = im.size();
28- width = size.width();
29- height = size.height();
30 }
31 awidth = width;
32 aheight = height;