mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Fixed the bug reported here: https://sourceforge.net/projects/greenshot/forums/forum/676082/topic/6510105/index/page/1
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:
parent
c352c4061b
commit
42011d2588
2 changed files with 21 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue