Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Sep 1, 2019
1 parent ecf099f commit c6ad0c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/animation/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from gui_core.gselect import Select
from gui_core.widgets import FloatValidator
from gui_core.wrap import SpinCtrl, CheckBox, TextCtrl, Button, \
BitmapButton, StaticText, StaticBox, Choice, RadioButton
BitmapButton, StaticText, StaticBox, Choice, RadioButton, EmptyImage

from animation.utils import TemporalMode, getRegisteredMaps, getNameAndLayer, getCpuCount
from animation.data import AnimationData, AnimLayer
Expand Down Expand Up @@ -1085,7 +1085,7 @@ def _createDecorationsProperties(self, panel):

# image
self.imageBox = wx.BoxSizer(wx.HORIZONTAL)
filetype, ltype = GetImageHandlers(wx.EmptyImage(10, 10))
filetype, ltype = GetImageHandlers(EmptyImage(10, 10))
self.browse = filebrowse.FileBrowseButton(
parent=panel, id=wx.ID_ANY, fileMask=filetype,
labelText=_("Image file:"),
Expand Down
6 changes: 3 additions & 3 deletions gui/wxpython/animation/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from core.utils import autoCropImageFromFile

from animation.utils import HashCmd, HashCmds, GetFileFromCmd, GetFileFromCmds
from gui_core.wrap import EmptyBitmap
from gui_core.wrap import EmptyBitmap, BitmapFromImage

import grass.script.core as gcore
from grass.script.task import cmdlist_to_tuple
Expand Down Expand Up @@ -308,7 +308,7 @@ def LoadOverlay(self, cmd):
cmdTuple[0], **cmdTuple[1])

if returncode == 0:
return wx.BitmapFromImage(autoCropImageFromFile(filename))
return BitmapFromImage(autoCropImageFromFile(filename))
else:
os.remove(filename)
raise GException(messages)
Expand Down Expand Up @@ -519,7 +519,7 @@ def Compose(self, cmdLists, regions, opacityList, bgcolor, force, nprocs):
self._bitmapPool[
HashCmds(
cmd_lists[i][0],
cmd_lists[i][1])] = wx.BitmapFromImage(
cmd_lists[i][1])] = BitmapFromImage(
wx.Image(filename))
os.remove(filename)
proc_count = 0
Expand Down
9 changes: 2 additions & 7 deletions gui/wxpython/animation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,8 @@ def RenderText(text, font, bgcolor, fgcolor):
def WxImageToPil(image):
"""Converts wx.Image to PIL image"""
pilImage = Image.new('RGB', (image.GetWidth(), image.GetHeight()))
getattr(
pilImage,
"frombytes",
getattr(
pilImage,
"fromstring"))(
image.GetData())
getattr(pilImage, "frombytes", getattr(pilImage, "fromstring"))(
bytes(image.GetData()))
return pilImage


Expand Down

0 comments on commit c6ad0c2

Please sign in to comment.