vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.77k stars 275 forks source link

Error: assert ""IsOk()"" failed in GetWidth(): invalid bitmap #758

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi, I installed poedit from Flathub via flatpak

flatpak install flathub net.poedit.Poedit

When I run it, it has two errors flatpak run net.poedit.Poedit

Gtk-Message: 21:07:29.251: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:07:29.252: Failed to load module "canberra-gtk-module"
Debug: Failed to connect to session manager: None of the authentication protocols specified are supported
./src/gtk/bitmap.cpp(937): assert ""IsOk()"" failed in GetWidth(): invalid bitmap
Debug: window wxTextCtrl(0x55912da24630) lost focus even though it didn't have it
Debug: window wxTextCtrl(0x55912da24630) lost focus even though it didn't have it

(net.poedit.Poedit:2): Gtk-CRITICAL **: 21:07:38.784: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
(net.poedit.Poedit:2): Gtk-CRITICAL **: 21:07:38.820: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

Debug: cannot read address information for stack frame #0
./src/gtk/bitmap.cpp(767): assert ""IsOk()"" failed in ConvertToImage(): invalid bitmap
./src/common/image.cpp(438): assert ""IsOk()"" failed in Scale(): invalid image
./src/gtk/bitmap.cpp(593): assert ""image.IsOk()"" failed in wxBitmap(): invalid image

(net.poedit.Poedit:2): Gtk-CRITICAL **: 21:07:50.489: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Debug: window wxTextCtrl(0x55912da24630) lost focus even though it didn't have it
Debug: window wxTextCtrl(0x55912da24630) lost focus even though it didn't have it

Ekran Görüntüsü - 2022-06-13 21-10-14

Ekran Görüntüsü - 2022-06-13 21-10-22

vslavik commented 2 years ago

We don't provide any official flatpak packages. Please provide basic information like the Poedit version in question and what wxGTK and GTK+ versions is it linked against.

Can you please also try using the package we do provide, i.e. snapcraft from https://snapcraft.io/poedit ?

While some parts are definitely a bug in Poedit (Scale() or ConvertToImage() shouldn't be called on invalid images, the problem that triggered it seems to be in packaging — notice the second screenshot complaining about /org/gtk/... path that didn't come from anything in Poedit, but must be coming from a MIME database or other configuration. IOW, that part seems to be a problem with the specific flatpak package used.

ghost commented 2 years ago

Poedit version: 3.1

wxWidgets version: 3.1.4

Due to it's a packaging bug, I opened issue to packagers.

Thanks.

Helltar commented 2 years ago

Same thing after updating wxWidgets (arch, kde, poedit from the official arch repo).

I lived with this problem for more than a week, as they wrote here https://github.com/flathub/net.poedit.Poedit/issues/37 you need to change the theme of the icons, it helped.

But in the end I found out that it's enough to copy one icon from Adwaita to your theme, namely:

/usr/share/icons/Adwaita/16x16/mimetypes/text-x-generic.png --> _icontheme/16x16/mimetypes/text-x-generic.png

Most likely the problem is related to .svg processing on some side, because it's the themes with svg icons that cause the error.

Although, changing the resolution of the existing text-x-generic.svg icon in your theme to .png is enough (even without conversion).