After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 546924 - "New Image" misscalculating dimensions for non-pixel sized templates
"New Image" misscalculating dimensions for non-pixel sized templates
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: High blocker
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-08-08 11:43 UTC by Joao S. O. Bueno
Modified: 2008-09-30 16:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix-template-resolution-notify-2008-08-17.patch (8.49 KB, patch)
2008-08-17 10:12 UTC, Martin Nordholts
rejected Details | Review
ugly-workaround-2008-09-29.patch (7.64 KB, patch)
2008-09-29 21:45 UTC, Martin Nordholts
rejected Details | Review

Description Joao S. O. Bueno 2008-08-08 11:43:11 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:
Comment 1 Alexia Death 2008-08-11 10:46:16 UTC
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.
Comment 2 Martin Nordholts 2008-08-17 10:12:32 UTC
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.
Comment 3 Michael Natterer 2008-08-17 16:56:33 UTC
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.
Comment 4 Sven Neumann 2008-09-23 07:24:18 UTC
This blocks the 2.6 release.
Comment 5 Martin Nordholts 2008-09-29 21:45:48 UTC
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.
Comment 6 Michael Natterer 2008-09-30 16:06:58 UTC
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.