[longomatch] Scales thumbnails if bigger than the max allowed size
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Scales thumbnails if bigger than the max allowed size
- Date: Sat, 11 Aug 2012 15:04:56 +0000 (UTC)
commit 3d16dc5dab30a81591f0ab34b7195051218f87c2
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Aug 8 21:20:47 2012 +0200
Scales thumbnails if bigger than the max allowed size
LongoMatch.Core/Common/Image.cs | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Image.cs b/LongoMatch.Core/Common/Image.cs
index c4bf1b3..a0882c0 100644
--- a/LongoMatch.Core/Common/Image.cs
+++ b/LongoMatch.Core/Common/Image.cs
@@ -29,8 +29,6 @@ namespace LongoMatch.Common
public class Image
{
- const int DEFAULT_MAX_HEIGHT = 100;
- const int DEFAULT_MAX_WIDTH = 100;
SImage image;
public Image (SImage image)
@@ -49,7 +47,7 @@ namespace LongoMatch.Common
}
public void Scale() {
- Scale (DEFAULT_MAX_WIDTH, DEFAULT_MAX_HEIGHT);
+ Scale (Constants.THUMBNAIL_MAX_WIDTH, Constants.THUMBNAIL_MAX_HEIGHT);
}
@@ -77,6 +75,19 @@ namespace LongoMatch.Common
public void Save (string filename) {
image.Save(filename, "png");
}
+
+ public int Width {
+ get {
+ return image.Width;
+ }
+ }
+
+ public int Height {
+ get {
+ return image.Height;
+ }
+ }
+
#else
public byte[] Serialize () {
if (image == null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]