GNOME Bugzilla – Bug 546924
"New Image" misscalculating dimensions for non-pixel sized templates
Last modified: 2008-09-30 16:06:58 UTC
Please describe the problem: Using GIMP SVn Trunk, try to open a new image using the A4 template. It comes up with an image larger than 800mm x 1m (at 300dpi) Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
This bug is only present when you invoke the New dialog after starting. It is present for all DPI based templates. Also after second template change the image size is calculated correctly. I believe this should be considered a blocker for 2.6.
Created attachment 116789 [details] [review] fix-template-resolution-notify-2008-08-17.patch The problem was introduced when gimp_config_sync() started to g_object_freeze_notify (G_OBJECT (dest)) which caused resolution notifies to be emitted after size. The attached patch implements GimpConfigInterface::copy() for GimpTemplate that makes sure resolution is copied first and that there is no notify freeze at that point. Would be cool if someone could take a look at the patch because I have a feeing I've forgot something.
I'm not sure about this patch, because freezing the notify is definitely the right thing to do. Let me think about another way of unbreaking this. Adding an own copy() implementation doesn't look like a bad start already.
This blocks the 2.6 release.
Created attachment 119617 [details] [review] ugly-workaround-2008-09-29.patch Making a proper fix for this is hard. I suggest we apply the attached ugly-fix which simply restores the old behavior for the problematic template syncing, and move this to the 2.8 milestone.
Fixed it differently by (ab)using existing API: 2008-09-30 Michael Natterer <mitch@gimp.org> Bug 546924 – "New Image" misscalculating dimensions for non-pixel sized templates * app/core/gimptemplate.h: added private param flag GIMP_TEMPLATE_PARAM_COPY_FIRST. * app/core/gimptemplate.c (gimp_template_class_init): set the flag on the resolution properties. * app/dialogs/image-new-dialog.c (image_new_template_changed): make sure the resolution properties are copied first. * libgimpconfig/gimpconfig-utils.c (gimp_config_sync): remove comment about fixing the template editor. That's not true any more.