RSS/Atom feed Twitter
Site is read-only, email is disabled

Initial Window Size Limit

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Initial Window Size Limit Kevin Myers 13 Jan 20:15
Initial Window Size Limit Kevin Myers 15 Jan 05:37
Kevin Myers
2003-01-13 20:15:59 UTC (over 21 years ago)

Initial Window Size Limit

Hi folks,

I'm running gimp 1.2.4, and working on some very large images with extremely high aspect ratios (i.e. length is MUCH longer than width). Over the past few months I have had several problems related to bugs in the code that the gimp was using to set the initial display scale with my images. Fortunately, Sven Neumann and others recently diagnosed and corrected most of these problems.

Additionally, I've made one further extremely simple patch to my own copy of the gimp. This patch causes the gimp to ignore the length of the long axis when determining the initial display scale, IF the aspect ratio of the image exceeds a cutoff value (I'm presently using 5:1 for the cutoff). This patch makes it MUCH easier and faster to work with my images, by avoiding the excessive amount of time that is otherwise required to zoom in to a reasonable scale. FWIW, aspect ratios on my images are typically on the order of 100:1.

The preceding patch mostly does what I want, but it still has one slight deficiency. When a high aspect ratio image ratio is displayed, the gimp is setting the window size for the long image dimension to a value that appears to be just slightly larger than the actual screen size, and making the image scrollable in that dimension. Since the window generally does not initially appear centered on the screen, this means that the first step I must take when working with my images is now to move and resize the window. Admittedly that isn't a severe problem, but I work with a lot of images, and any additional steps that I can avoid add up to a lot of time in the long run.

So, what I would like to do is alter the gimp's behavior slightly when determining the window size for an image which is scaled such that it exceeds the screen size. Rather than set the window size equal to the screen size in any dimension for which the screen size has been exceeded, I would like to set the window size to something like 80 percent of the screen size. Note that the result of the original image scaling routine is to set the image scale such that the window size is approximately 75 to 80 percent of screen size, and I would like to size the window similarly even if the image size exceeds the screen size.

Can someone please point me to the location of the gimp's code that determines what window size to use when the scaled image won't fit on the screen? I'm guessing that a very simple patch to that code should make the gimp do exactly what I want.

Any help would be greatly appreciated. Thanks in advance!

s/KAM

P.S. - Once I get these patches completed, I plan to submit them for permanent incorporation into the gimp. They would be very useful for anyone else who works with high aspect ratio images.

Kevin Myers
2003-01-15 05:37:37 UTC (over 21 years ago)

Initial Window Size Limit

Hi Sven -

Thanks for the info. Unfortunately I can't really afford to take time out right now to attempt to figure out how to build and test in the 1.3 track, especially since I'm running under Windows and would have to be on the bleeding edge of dealing with porting issues.

However, the additional code that I needed turned out to really be quite simple and was just something that I overlooked initially. I'm going to open a bug on 1.2.4 and supply my patch for that. Hopefully you or one of the other fine gimp maintainers out there will be able to easily figure out if and where this patch should be applied to 1.3. It's only a few lines of additional code added to the create_display_shell routine of app/interface.c in the same vicinity as the other changes that you made recently. Thanks again.

Regards,
s/KAM

----- Original Message ----- From: "Sven Neumann"
To: "Kevin Myers"
Sent: Monday, January 13, 2003 2:23 PM Subject: Re: [Gimp-developer] Initial Window Size Limit

Hi,

"Kevin Myers" writes:

Can someone please point me to the location of the gimp's code that determines what window size to use when the scaled image won't fit on

the

screen? I'm guessing that a very simple patch to that code should make

the

gimp do exactly what I want.

I'd suggest you do this change in the 1.3 tree since it much cleaner there. In particular it doesn't have to deal with the GdkWindow since gtk+-2.0 offers the gtk_window_resize() API which does all the dirty work. The code you are looking for is in the functions gimp_display_shell_new() and gimp_display_shell_shrink_wrap() in app/display/gimpdisplayshell.c. I'm not sure if I understood your request correctly, but I think that 1.3 might alredeady behave as you described as the desired behaviour.

If you are really forced to hack on 1.2, I wish you good luck. That code has caused a lot of grief and is substantially broken in the 1.2 tree. IIRC, it's located in interface.c in app/create_display_shell() and in g_display_shrink() in app/gdisplay_ops.c.

Salut, Sven