Closed DeniGam closed 3 years ago
Usually when this happens there is no preview embedded in the file. Can you confirm that there is?
Hello. Interesting, it looks like the issue with not latin letters in the path (cyrillic in my case), because thesame file in folder without cyrillic letters has preview but in other with cyrillic letter - hasn't. Can you confirm this limitation? or possible you know how to deal with this (just rename folder is not a good solution for me, because not all user of my cloud know English well)
Yeah this is probably a limitation of php's escape_shell_args function. This function is using the environment locale settings. Your server is probably setup to English locale. I think i can work around this somehow but it might take a while before I have time. Pull requests are welcome.
@DeniGam Du you have an example folder name that I can use to test with? In my testing random russian words works fine.
@DeniGam One more thing. can you run "locale" and post the output here. That way I can simulate your settings and provide a fix for this.
'CR2 проблема' - is broken
'CR2 issue' - is work fine
locale:
LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8
Initially it was:
C C.UTF-8 en_US.utf8 POSIX
Than I've added en_US.UTF-8 setup and installation of 'locales' and 'locales-all' package to my Dockerfile but it is change nothing.
Can you confirm that these values are actually used by php somehow? You can run this for instance in a php script, but make sure it is executed through apache:
$currentLocale = setlocale(LC_ALL, 0);
echo $currentLocale;
I opened php console by
php -a
and execute:
php > $currentLocale = setlocale(LC_ALL, 0);
php > echo $currentLocale;
LC_CTYPE=uk_UA.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
but I'm not sure that it is executed through apache. Can you give me more details about how to run it correct way?
If you could put this into a php file and run that under the same apache instance as your nextcloud that would be best. That way we would sure.
I tried putting the same values you had in my php setup and I can not reproduce your problem at all.
@DeniGam Here is an example file that you could load through apache:
<?php
$currentLocale = setlocale(LC_ALL, 0);
var_dump($currentLocale);
I would really appreciate if you could help me reproduce this.
Hi @ariselseng . I'm not quite understand where I can locate this file and how I can run it.
@DeniGam Ah, I would put it in the same folder as the nextcloud files, like /var/www/html. Call it "test.php", and then, depending on your setup, you should be able to reach it by http://YOURNEXTCLOUD/test.php. Are you using apache? if not, then you might not be able to reach it so easily.
Ok. It looks like I found another way - I modified status.php, and add 'currentLocale' => setlocale(LC_ALL, 0), and then I call /status.php.
The result:
{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"22.2.0.2","versionstring":"22.2.0","edition":"","productname":"Nextcloud","extendedSupport":false,"currentLocale":"C"}
I know that this is not exactly you've asked me, but when I try to put the file to the directory and call it - it always tries to redirect me to HTTPS protocol and returns SSL-protocol error. So I guess my option is in general the same.
@DeniGam Thank you! I had the same value as you. Could you send me a zip file with a folder with the special characters an a raw file? I tried creating a folder named "Фото" and putting a raw file into it, but it just worked :/
You may download this here: https://drive.google.com/file/d/1Xe1vIrGkIsM39fqqrVLEQ4rXpUiu142W/view?usp=sharing And one more thing, possible I know why it may works for you - NC uses some cache for created previews (and looks like it attached to file itself, not to path). That's why if I initially rename the folder to English, than open preview (it works fine), and then rename it to Russian - the preview will work for this file
A fix is coming soon. I was able to reproduce it now reliably.
@DeniGam Please try version 0.7.13, should be available in your Nextcloud in an hour or less.
Yes, now it works! Thank you a lot for your help and for your time!
Finally! :D
Previews are not shown for *.CR2 files. Nextcloud: 22.2.0 (in docker based on latest image) Host system: Ubuntu-server 20.04 LTC
php --version:
PHP 8.0.12 (cli) (built: Oct 21 2021 15:29:13) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.12, Copyright (c) Zend Technologies with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies
apt list --installed | grep imagemagick:
imagemagick-6-common/now 8:6.9.11.60+dfsg-1.3 all [installed,local] imagemagick-6.q16/now 8:6.9.11.60+dfsg-1.3 amd64 [installed,local] imagemagick/now 8:6.9.11.60+dfsg-1.3 amd64 [installed,local]
"Exception":"Exception", "Message":"Unable to find preview data: /var/www/html/custom_apps/camerarawpreviews/vendor/exiftool/exiftool/exiftool.bin -json -preview:all -FileType '/var/www/html/data/denigam/files/familyShare//Canon EOS 800D/2020.12.16/IMG_1316.CR2' -> ", "Code":0
Please see full trace