thezbyg / gpick

Advanced color picker written in C++ using GTK+ toolkit
BSD 3-Clause "New" or "Revised" License
376 stars 33 forks source link

Color palette cant and wont be loaded (File could not be opened) #189

Open WGRM opened 3 years ago

WGRM commented 3 years ago

Hello.

I occasionally use Gpick and already "collected" some colors. Since the current Debian version had some problems, i downloaded the source and compiled it myself. The problems persist. Namely:

This made the error messages go away and the UI, except "view->layout", seems to work. Including html color values and names. It would be usable now, if it wouldn't deny to load its own created color palette. (File could not be opened) It won't load the older one either. It does import the exported colors from the "*.gpl" file.

Is there any hope, that this problem will be addressed in the near future?

thezbyg commented 3 years ago

Hi,

which version did you compile? There were palette file loading issues in the following commit range: c9091843..ed0c7ab5. If your version is inside this range, then you will have to update to a newer version.

In which directory did you install Gpick? If installation directory is not listed in XDG_DATA_HOME or XDG_DATA_DIRS environment variables, then Gpick will not find resource files including *.lua files.

View->Layout menu seems to be broken. I am currently investigating and I will fix as soon as possible.

WGRM commented 3 years ago

The folder just states GPick 2.6. It was the latest stable version available. It was my first own compiled program, although i'm on Linux for more than a decade. It's Debian, i'm used to "old but stable". ;)

I compiled it for two paths:

  1. /home/user/.local
  2. /usr/local

Both had the problems. 'XDG_DATA_DIRS' is usually being set automatically and always sets '/home/user/.local/share'. The error message suggests those files being expected in 'XDG_DATA_HOME'.

I'm currently using it with linked files and importing/exporting my table. Looking forward for a working version.

Best regards.

thezbyg commented 3 years ago

View->Layout menu should be fixed now.

Does the directory _$XDG_DATAHOME/gpick/ exist? And if it does, are Gpick files installed there? I can reproduce *.lua file load errors by creating empty /home/user/.local/share/gpick/ directory. This causes problems, because Gpick simply selects first data path containing gpick/ subdirectory by checking _XDG_DATAHOME and all directories in _XDG_DATADIRS. If _XDG_DATAHOME environment variable is not set, then it defaults to /home/user/.local/share/ and this path is selected because subdirectory gpick/ exists, causing following error on startup:

Lua load error: module 'init' not found:
    no field package.preload['init']
    no file './init.lua'
    no file '/home/user/.local/share/gpick/init.lua'
    no file '/home/user/.config/gpick/init.lua'

I can not reproduce your palette file loading problem. Please update to master and try again. Also, please create a random palette, save and send the file to me so that I could inspect it and make sure that files are saved correctly.

WGRM commented 3 years ago

The releases still states 0.2.6 from the 23 Dec 2020. So i guess i have to 'git clone' to get the current version? Gotta mention, it's really simple. I'll give it a try.

WGRM commented 3 years ago

I can not test it. 'checkinstall' gives the following error:


CMake Error at cmake_install.cmake:77 (file):
  file INSTALL cannot find
  "/path/to/user/sources/gpick/share/gpick/converters.lua".

The file is there, the permissions are right. I don't know why it throws the error. I have to use 'checkinstall' because i don't want to mess up my system.

WGRM commented 3 years ago

This is my error:

Lua load error: module 'init' not found:
    no field package.preload['init']
    no file './init.lua'
    no file '/path/to/user/.data/gpick/init.lua'
    no file '/path/to/user/.config/gpick/init.lua'
    no file '/usr/local/lib/lua/5.3/init.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/init.so'
    no file '/usr/lib/lua/5.3/init.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './init.so

This is the release 2.6.

thezbyg commented 3 years ago

You can, but do not have to use git clone to get latest version. Instead, you can use following link to download latest source archive: https://github.com/thezbyg/gpick/archive/master.zip.

I tried using checkinstall, and the following commands successfully produced a *.deb file:

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
fakeroot checkinstall --install=no --pkgname=gpick --pkgversion=0.2.6 --pkggroup=graphics --nodoc --default

So I have no idea why it fails for you.

Does directory /path/to/user/.data/gpick/ exist? Is it empty? Or does it contain *.lua, *.txt and *.png files?

WGRM commented 3 years ago

Now that you mention it... Thats correct. $HOME/.data/gpick/existed. I wondered about it, because it didn't contain any files and although i deleted it (or had one empty one - not sure anymore), it was created again. I remember, because i'm picky about XDG and i observe where packages put their files.

Hm. Tested it again. Deleted the .data gpick directory and the errors went away. Maybe it was the older Debian version, which created it again.

Ah! I just remembered and got it. I did create the .data gpick, because i wanted to place my color palette in there and did so!

WGRM commented 3 years ago

That's what i get:

https://asciinema.org/a/rYlwi0FFTuFDNrqHnZb9MYgJl

I did work with the 2.6 release package. Fakeroot didn't change anything.