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

No thumbnails preview. #121

Open
softyoda opened this issue Mar 9, 2017 · 6 comments
Open

No thumbnails preview. #121

softyoda opened this issue Mar 9, 2017 · 6 comments

Comments

@softyoda
Copy link

softyoda commented Mar 9, 2017

Hello, i have a problem, i havn't any preview of the picture, and with folder with a folder.jpg, no thumbnails.
I have the last version of Minigal and PHP and all flower are in chmod 775, i also use nginx.

I don't have any flower "thumb".

@nodiscc
Copy link
Contributor

nodiscc commented Mar 10, 2017

  • Do you have the PHP GD extension installed and enabled?
  • Are there any errors in your webserver logs or browser console?

@softyoda
Copy link
Author

Ok it worked with $ sudo apt-get install php7.0-gd
and $ sudo service nginx restart

Thank you

@softyoda
Copy link
Author

Thumbnails caching : No : You should let php create and use the 'thumbs" directory. MiniGal will be much faster.

I don't know why it don't save thumbnails in a folder.

@nodiscc
Copy link
Contributor

nodiscc commented Mar 11, 2017

  • any errors in your webserver logs or browser console?
  • The thumbs directory should have read/write/execute permissions for the user or group running the webserver (usually on Debian-based systems it's www-data)

@softyoda
Copy link
Author

In my browser console, i have this error : TypeError: document.getElementById(...) is null

I did not found any log in my /var/log/nginx/error.log

And i have set all permision to chmod -R 775

The solutioni have find is to set all right to execute, but i prefere desactivate it in the public web, so i generate my tumbs with the right to execute and then, i desactivate after, because i don't want anybody to execute an injection.

@nodiscc
Copy link
Contributor

nodiscc commented Mar 12, 2017

@softyoda Having file mode 0775 is not enough, you need to ensure files have proper owner/group as well.

set all right to execute

If this works then you probably have wrong ownership on your files. The preferred way to restrict permissions to the minimum is:

  • create the thumbs directory: mkdir /var/www/minigalnano/thumbs
  • set minigalnano files/dirs ownership to root:www-data: chown -R /var/www/minigalnano root:www-data
  • ensure files are mode 0640 and directories mode 0750:
find /var/www/minigalnano -type f -print0 | xargs -0 chmod -c 640
find /var/www/minigalnano -type d -print0 | xargs -0 chmod -c 750
  • give the webserver write access only to required directories: chown -R www-data:www-data /var/www/minigalnano/thumbs

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

No branches or pull requests

2 participants