I want to use node-canvas and when I try to render text, I get this Error:
Assertion failed: (!scaled_font->cache_frozen), function
_cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459. Abort trap: 6
Here some sample code:
ctx.fillStyle = 'black'
ctx._setFont(Weight, Style, FontSize, 'px', 'Arial')
ctx.fillText("Hello, World!", 50, 50)
.fillText crashed all the time, with the same error.
Maybe it's a problem with cario. Not sure what's going wrong there.
My set up:
Mac OS 10.13.6, canvas#^2.0.0-alpha.17 and installed the packages via brew install pkg-config cairo pango libpng jpeg giflib librsvg.
I wrote some comment at github here: node-canvas
I find this post on github. When i use node canvas-prebuilt it works for me. Then there is no problem with text rendering.
It means installing canvas-prebuild with npm install canvas-prebuilt and load the module with require('canvas-prebuilt').
Related
I am a Mac user and I am trying to open raster files (gri format files).
I am trying to install raster and rgdal packages and I installed raster pacakage, but having trouble installing rgdal package.
I tried different ways such as installing using home brew from Mac terminal, or following below codes:
install.packages('rgdal', type = "source", configure.args=c(
'--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config',
'--with-proj-include=/Library/Frameworks/PROJ.framework/Headers',
'--with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'))
But no luck at all!
I would appreciate your help with this.
Hi I am new to the hardware programming
I was trying to install the esptool plugin in Thonny IDE but it is showing the error like below .
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Error: process returned with code 1
If you have any idea about this please reply
I am using Windows 10 and Strawberry Perl. I found this nice tutorial on building a 3D engine in Perl. Which requires SDL. For a couple of days I've been trying to install it, but it doesn't work. First I tried via CPAN, no success. No I am trying manually, but I am getting error messages when using "make". If I type "perl -V:make" it says I should use "dmake". If I do so, there's a dmake warning, telling me to use gmake instead. If I do that, there's the following message:
"to undefined at C:/Perl64/site/lib/ExtUtils/Install.pm line 1199. gmake: *** [Makefile:942: pm_to_blib] Error 2"
Any suggestions how to fix this? Or is there an easy (easier) way to install SDL?
It seems like the Perl SDL module uses SDL version 1.2.14, whereas the documentation says
The best course of action is to move to SDL 2.0 or later as quickly as
possible
So, I would recommend looking at the Python bindings PySDL2 instead. The following worked for me on Windows 10:
Downloaded Python 3.8 from here:
https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe
Then added the following to the User enviroment variables for "Path" (NOTE: at the beginning, not at the end):
%USERPROFILE%\AppData\Local\Programs\Python\Python38
%USERPROFILE%\AppData\Local\Programs\Python\Python38\Scripts
Then, from the command prompt install pysdl2:
>pip install pysdl2
Collecting pysdl2
Downloading https://files.pythonhosted.org/packages/60/ba/ddb48261848874eeb3d54963edbf3c74fff86499746aeb23151f123953bb/PySDL2-0.9.7-py3-none-any.whl (541kB)
|████████████████████████████████| 542kB 2.2MB/s
Installing collected packages: pysdl2
Successfully installed pysdl2-0.9.7
>pip install pysdl2-dll
Collecting pysdl2-dll
Downloading https://files.pythonhosted.org/packages/01/37/f9aa5472fb85ce94507c69110916133ad29b650d2bf277de2cce37d7ad7d/pysdl2_dll-2.0.12-py2.py3-none-win_amd64.whl (2.5MB)
|████████████████████████████████| 2.5MB 3.2MB/s
Installing collected packages: pysdl2-dll
Successfully installed pysdl2-dll-2.0.12
Then, add a new User environment variable PYTHONPATH with value:
%USERPROFILE%\AppData\Local\Programs\Python\Python38\Lib\site-packages
Close the command prompt, and reopen a new one to update the environment variables. Then I created a test Python script:
import sys
import sdl2.ext
resource_dir=r'C:\Users\hakon\AppData\Local\Programs\Python\Python38\Lib\site-packages\sdl2\examples'
RESOURCES = sdl2.ext.Resources(resource_dir, "resources")
sdl2.ext.init()
window = sdl2.ext.Window("Hello World!", size=(640, 480))
window.show()
factory = sdl2.ext.SpriteFactory(sdl2.ext.SOFTWARE)
sprite = factory.from_image(RESOURCES.get_path("hello.bmp"))
spriterenderer = factory.create_sprite_render_system(window)
spriterenderer.render(sprite)
processor = sdl2.ext.TestEventProcessor()
processor.run(window)
sdl2.ext.quit()
and finally run it from the command prompt:
> python test.py
My System:
- ArchLinux
- LibreOfficeFresh 5.0.2-3
- Xorg116
- Catalyst Graphics Drivers
Problem:
LibreOfficeFresh is unable to start since I have installed catalyst, so since i switched
from MESA to catalyst.
Error Description:
[tekkkz#thinkpad ~]$ libreoffice
(soffice:1022): GLib-GObject-CRITICAL **: g_value_set_boxed: assertion 'G_VALUE_HOLDS_BOXED (value)' failed
(soffice:1022): GLib-GObject-WARNING **: gtype.c:4268: type id '0' is invalid
(soffice:1022): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced
Application Error
Someone an idea how I can get my LibreOffice working again?
Thanks for help,
Tekkkz
this is the message that I saw when upgrading today
(18/24) upgrading libreoffice-fresh [##############################] 100%
> LibreOffice now uses highly experimental gtk3 vcl by default
> on some desktops. To use stable gtk2 vcl uncomment
> it in /etc/profile.d/libreoffice-fresh.{sh,csh}
So you can try that, uncomment the line export SAL_USE_VCLPLUGIN=gtk
and re-login, if you don't want to logout, you have to export the variable manually in a terminal and run libreoffice from that terminal inmediately after exporting the variable.
export SAL_USE_VCLPLUGIN=gtk
soffice
I do that, and it works right now
It seems to be a problem with GTK themes (and a recent change between GTK2/3). Try changing themes and see if it starts working again (it did for me).
Getting an error when trying to convert sequence of jpgs to gifs. Can't seem to figure out how to add a palette, or if that's the actual problem. Was able to get gifs to load using the numpy arrays in the images2gif.py main.
import PIL
from PIL import Image
import StringIO
import images2gif
images = []
for frame in animation1.frames:
img_data = s3manager.get_file_as_string(frame.s3_filename)
image = Image.open(StringIO.StringIO(img_data))
images.append(image)
images2gif.writeGif('lala3.gif', images, duration=0.5, dither=0)
With this I get the following error:
"images2gif.py", line 436, in writeGifToFile
fp.write(globalPalette)
TypeError: must be string or buffer, not None
Not sure how to specify a palette for these jpgs. documentation unclear to me, and not even sure if that's the issue. help?
In images2gif.py change line 200:
for im in images:
palettes.append( getheader(im)[1] )
to
for im in images:
palettes.append(im.palette.getdata()[1])
images2gif author seems to be willing to drop support for pillow. See this thread :
https://code.google.com/p/visvis/issues/detail?id=81
From this thread too, i found a fixed version of that script, which works with me (with pillow 2.4). It is available here :
https://github.com/rec/echomesh/blob/master/code/python/external/images2gif.py and produces good quality gif with any kind of PNG (P mode too)
images2gif.py uses getheader function from PIL.GifImagePlugin to get the palettes.
For some reason, it doesn't work with image you read. Maybe the script doesn't really work if source images are not 'P' mode.
I installed PIL after Pillow and it started to work. Seems like both libraries are needed for some reason. Here is how to reinstall both:
pip uninstall PIL
pip uninstall Pillow
pip install Pillow
pip install PIL