A big bug in the Linux version of Pinta has stopped me from using it as my Photoshop replacement. Here’s my situation: I have an image of one of our Superwoman models, for example, that is quite large, but Superwoman herself is quite tiny, in the middle of the background. I select the whole image, and copy it to the clipboard as-is. I don’t want to use the select or crop tool. I create a new canvas that is smaller than the source image in either height or width, and then paste in my image to the new canvas, so I can move it around and position it just right without having to guess using the select tool on the original.

Make sense? Hopefully! Anyhow, Pinta in its default state, SQUASHES the image to fit the canvas, if you tell it not to resize the canvas, and it looks completely wrong, it literally squashes the image from top down, you know what that looks like without a screenshot, right? I’ve fixed it in my own sourcecode copy and Pinta now behaves as I want it to. I’m not sure the devs would want my changes, but I’ll ask anyhow.

1. Grab a copy of the source, by whatever means by using Terminal (install Git first using “sudo apt-get install git”).

2. Then clone the repo with: “git clone git://github.com/PintaProject/Pinta.git”.

3. Now your source tree is ready, it will be in your Home folder under a folder called ‘pinta’. Install MonoDevelop, and open the Pinta.sln solution file using it.

4. Once open, find the Pinta.Core/Classes/Document.cs file, and after line 806, find:

            // If the pasted image would fall off bottom- or right-
// side of image, adjust paste position
x = Math.Max (0, Math.Min (x, canvas_size.Width – cbImage.Width));
y = Math.Max (0, Math.Min (y, canvas_size.Height – cbImage.Height));

Simply change it so it looks like this:

             // Modified by Tidosho. Image would be stretched/squashed if canvas was smaller and user chooses not to resize it.
//
// If the pasted image would fall off bottom- or right-
// side of image, adjust paste position
//x = Math.Max (0, Math.Min (x, canvas_size.Width – cbImage.Width));
//y = Math.Max (0, Math.Min (y, canvas_size.Height – cbImage.Height));

It’s a bit of a dirty hack, as it simply comments the procedure out, but it works. A possible fulltime modification could be a controllable scale type operation like in Photoshop where you control the scale using handles round the image, but I don’t think Pinta has a scale API.

UPDATE: It isn’t as serious as I first thought, but still annoying. The reason the image is squashed when pasted is because Pinta uses squashed thumbnails for use in the open documents list, and the History. As soon as you drag the layer pasted in, it corrects itself, but then you have to drag it back into position.

 

Be Sociable, Share!
Leave a Reply