Opened 8 years ago
Closed 6 years ago
#3153 closed defect (fixed)
g.gui.animation freezes when trying to add decorations
Reported by: | veroandreo | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.4 |
Component: | wxGUI | Version: | svn-trunk |
Keywords: | g.gui.animation | Cc: | |
CPU: | Unspecified | Platform: | Linux |
Description
g.gui.animation freezes when trying to add decorations and the only possibility is to close it, loosing all the settings.
Traceback (most recent call last): File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/gui/wxpython/animation/dialogs.py", line 1502, in OnExport decorations=self.GetDecorations()) File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/pydispatch/signal.py", line 229, in emit dispatcher.send(signal=self, *args, **kwargs) File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/pydispatch/dispatcher.py", line 349, in send **named File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/pydispatch/robustapply.py", line 60, in robustApply return receiver(*arguments, **named) File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/gui/wxpython/animation/controller.py", line 610, in _export bgcolor, fgcolor).ConvertToImage() File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/gui/wxpython/animation/utils.py", line 250, in RenderText w, h = dc.GetTextExtent(text) File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/_gdi.py", line 4127, in GetTextExtent return _gdi_.DC_GetTextExtent(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "m_graphicContext" failed at ./src/common/dcgraph.cpp(1147) in DoGetTextExtent(): wxGCDC(cg)::DoGetTextExtent - invalid DC
It would be useful to be able to export those settings or configurations to keep them as templates, then, or so.
Attachments (2)
Change History (24)
comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
Sorry for the delay...
I just select a raster or vector time series to display, then go to "export animation" and before actually exporting, I add some decoration, i.e.: timestamp, image or text, and when I click over export, rather nothing happens or "Preparing export, please wait..." sign freezes in the screen forever, while in the output window, I get the same error as reported before...
System info:
GRASS version: 7.3.svn GRASS SVN revision: r69574M Build date: 2016-09-26 Build platform: x86_64-pc-linux-gnu GDAL: 2.0.2 PROJ.4: 4.9.2 GEOS: 3.5.0 SQLite: 3.13.0 Python: 2.7.12 wxPython: 3.0.2.0 Platform: Linux-4.7.4-200.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
comment:3 by , 8 years ago
I still can't reproduce it, even with wxpython 3.0.2.0. First try using different font, but I don't think that would help. Next try to apply this change and recompile:
Index: animation/utils.py =================================================================== --- animation/utils.py (revision 69577) +++ animation/utils.py (working copy) @@ -245,7 +245,7 @@ def RenderText(text, font, bgcolor, fgcolor): """Renderes text with given font to bitmap.""" - dc = wx.MemoryDC() + dc = wx.MemoryDC(wx.EmptyBitmap(20, 20)) dc.SetFont(font) w, h = dc.GetTextExtent(text) bmp = wx.EmptyBitmap(w + 2, h + 2)
I hope this could help, otherwise I have no idea.
comment:4 by , 8 years ago
Unfortunatelly, no... still same behaviour with a freshly updated trunk r69591M :( No idea
comment:5 by , 8 years ago
It might be something specific for Fedora. I hoped that diff could fix it, but I am clueless now.
follow-up: 7 comment:6 by , 8 years ago
I have the same issue (also on F24). Any hints how to debug that?
comment:7 by , 8 years ago
Replying to neteler:
I have the same issue (also on F24). Any hints how to debug that?
That diff is the only idea I have, please try it. You can also put there
print dc.IsOk()
before
w, h = dc.GetTextExtent(text)
to see if the dc is ok to use.
by , 8 years ago
Attachment: | g_gui_animation_refresh_missing.jpg added |
---|
g.gui.animation: refresh missing
follow-up: 9 comment:8 by , 8 years ago
I applied the patch and it no longer freezes. The print patch did not have any effect (nothing is printed).
I attach a screenshot to show that when enlarging the window black borders come up which have a refresh issue when moving the legend around. Perhaps related?
I'm using wxPython-3.0.2.0-10.fc24.x86_64.
comment:9 by , 8 years ago
Replying to neteler:
I applied the patch and it no longer freezes. The print patch did not have any effect (nothing is printed).
So do you confirm the patch solved the issue? Do the exported images/gif and the text look correct?
I attach a screenshot to show that when enlarging the window black borders come up which have a refresh issue when moving the legend around. Perhaps related?
Could be related, but it's a little bit different problem, please create a new ticket.
comment:10 by , 8 years ago
I applied the patch. Buttons "Cancel" and "Export" still freeze when I add decorations (i.e.: remain completely irresponsive) if I try to click on them. Luckily, I can reach them by <Tab> and the animation is exported correctly with the decorations I added. However in the teminal I get the following:
/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/imaging/images2gif.py:344: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future im2 = im[y0:y1, x0:x1]
If I do not add any decorations and only export the animation as-is directly, buttons work fine. But I get the same warning in the terminal:
/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/imaging/images2gif.py:344: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future im2 = im[y0:y1, x0:x1]
Tested with a STRDS in NC climatic Location. Grass trunk, revision=r69647M. If you have any ideas, I'm happy to keep testing.
comment:11 by , 8 years ago
I committed the patch and backported it. That's about all I can do now. I suggest to close this and open new tickets if needed.
comment:12 by , 8 years ago
I have tested both in trunk r69822 and 72 release branch r69821 and the issue prevails. Steps to reproduce are:
- call g.gui.animation from terminal
- add new animation
- add stvds -> ok -> ok (animation works fine)
- go to export icon
- set a file type and name
- go to decorations tab
- add text
- click export from there... No way, it does not respond. It is frozen. The only remaining option is to close.
If you try to export directly, without touching the decoration tab, it works fine. However you don't get any decoration.
follow-up: 14 comment:13 by , 8 years ago
I understood the patch was working for Markus. You have both Fedora, right?
comment:14 by , 8 years ago
Replying to annakrat:
I understood the patch was working for Markus.
I followed the procedure of Vero: I can still switch between "Format" und "Decorations" tab but both the "Cancel" and "Export" buttons are like disabled.
In the terminal there is many times:
(g.gui.animation:6695): Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
You have both Fedora, right?
Yes.
follow-up: 16 comment:15 by , 8 years ago
Just to clarify: (for me) g.gui.animation is not freezing, I think the ticket's title is a bit misleading. "Simply" the buttons get somehow disconnected, i.e. deactivated in the decorations dialog while the tabs etc remain working.
Closing the decorations dialog with the upper right X brings me back to the main window of the module which remains working (except for this decorations dialog.
comment:16 by , 8 years ago
Replying to neteler:
Just to clarify: (for me) g.gui.animation is not freezing, I think the ticket's title is a bit misleading. "Simply" the buttons get somehow disconnected, i.e. deactivated in the decorations dialog while the tabs etc remain working.
Closing the decorations dialog with the upper right X brings me back to the main window of the module which remains working (except for this decorations dialog.
Yes, the same for me... Sorry if the tittle is missleading, did not find the proper words at time :(
comment:18 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:21 by , 7 years ago
Milestone: | → 7.2.4 |
---|
comment:22 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I can't reproduce the reported bahavior any longer, closing
I can't reproduce it with wxPython 3.0.2.0 on Ubuntu 16. What are the exact steps and configuration?