Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WGRM opened this issue Jan 20, 2021 · 9 comments
Open

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

WGRM opened this issue Jan 20, 2021 · 9 comments
Assignees
Labels

Comments

@WGRM
Copy link

WGRM commented Jan 20, 2021

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:

  • I had to link the files "converters.lua", "helpers.lua", "init.lua", "layouts.lua" and "options.lua" into the "$XDG_CONFIG_HOME"

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
Copy link
Owner

thezbyg commented Jan 22, 2021

Hi,

which version did you compile? There were palette file loading issues in the following commit range: c909184..ed0c7ab. 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.

@thezbyg thezbyg self-assigned this Jan 22, 2021
@thezbyg thezbyg added the bug label Jan 22, 2021
@WGRM
Copy link
Author

WGRM commented Jan 22, 2021

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 added a commit that referenced this issue Jan 29, 2021
Do not use temporary string in g_object_set_data_full() call.

Issue #189.
@thezbyg
Copy link
Owner

thezbyg commented Jan 29, 2021

View->Layout menu should be fixed now.

Does the directory $XDG_DATA_HOME/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_DATA_HOME and all directories in XDG_DATA_DIRS. If XDG_DATA_HOME 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
Copy link
Author

WGRM commented Jan 29, 2021

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
Copy link
Author

WGRM commented Jan 29, 2021

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
Copy link
Author

WGRM commented Jan 29, 2021

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
Copy link
Owner

thezbyg commented Jan 30, 2021

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
Copy link
Author

WGRM commented Jan 31, 2021

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
Copy link
Author

WGRM commented Jan 31, 2021

That's what i get:

https://asciinema.org/a/rYlwi0FFTuFDNrqHnZb9MYgJl

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

thezbyg added a commit that referenced this issue May 29, 2021
Validate data directory by checking for known file.

Issue #189.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants