The resizing didn't work, after the resizing was fixed the OCR didn't work and I had to change to resize the canvas... now it seems to be working again.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2410 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-01-05 23:55:36 +00:00
commit 42011d2588
2 changed files with 21 additions and 3 deletions

View file

@ -147,8 +147,16 @@ namespace GreenshotOCR {
// Also we need to check the size, resize if needed to 130x130 this is the minimum
if (surface.Image.Width < MIN_WIDTH || surface.Image.Height < MIN_HEIGHT) {
IEffect resizeEffect = new ResizeEffect(Math.Max(surface.Image.Width, MIN_WIDTH), Math.Max(surface.Image.Height, MIN_HEIGHT), true);
outputSettings.Effects.Add(resizeEffect);
int addedWidth = MIN_WIDTH - surface.Image.Width;
if (addedWidth < 0) {
addedWidth = 0;
}
int addedHeight = MIN_HEIGHT - surface.Image.Height;
if (addedHeight < 0) {
addedHeight = 0;
}
IEffect effect = new ResizeCanvasEffect(addedWidth / 2, addedWidth / 2, addedHeight / 2, addedHeight / 2);
outputSettings.Effects.Add(effect);
}
filePath = ImageOutput.SaveToTmpFile(surface, outputSettings, null);