| 48 | }; |
| 49 | |
| 50 | Tile::Tile(QString filename) |
| 51 | { |
| 52 | image.load(filename); |
| 53 | if (!image.isNull()) { |
| 54 | if (image.width() > MAX_SIZE || image.height() > image.width()) { |
| 55 | // Invalidate image |
| 56 | image.loadFromData(NULL, 0); |
| 57 | } else { |
| 58 | if (image.height() < image.width()) { |
| 59 | isResized = true; |
| 60 | image.scaled(image.width(), image.width(), Qt::KeepAspectRatio); |
| 61 | } |
| 62 | size = image.width(); |
| 63 | precalcEdgeColors(); |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | Tile::Tile(QImage image, bool isResized, bool isDuplicate) |
| 69 | { |