![]() |
|
Problem with "umlaut" in photo filenames - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Problem with "umlaut" in photo filenames (/thread-10004.html) Pages:
1
2
|
Problem with "umlaut" in photo filenames - Opunte - 2012-05-21 Hi, If a file or a folder contains a german "umlaut" like ä,ö,ü I cannot view the original file (option unsecure is set in image settings). If I set it to download the photo, this works. I've seen this error in the httpd logs when viewing such a file: And for videos with preview image (video.mp4 and video.jpg in a folder) the display of the preview image does not work if it contains umlauts. Instead the default image is shown. I have tested this with Zenphoto 1.4.2.4 and the default theme on FreeBSD/Apache 2.2/PHP 5.3. Can someone help debugging this? Problem with "umlaut" in photo filenames - sbillard - 2012-05-21 When you installed Zenphoto did you make the character set test file as suggested? Your problem is that the character set of the file name is not what Zenphoto has been told to expect. If you did to the test file and paid attention to setup warnings these things should be properly discovered. Problem with "umlaut" in photo filenames - Opunte - 2012-05-22 The charset is set to what the setup script suggested: ISO?8859?1. I've just done a test with a new installation of Zenphoto 1.4.2.4, created "zp-data/charset-tést" and the setup recognized it. The setup (german) message was "Der Zenphoto-Dateisystem-Zeichensatz ist als ISO?8859?1 definiert [bestätigt]". Hm, I'm a bit clueless about what to test next. Problem with "umlaut" in photo filenames - acrylian - 2012-05-22 I can only recommend to avoid any special characters in file and folder names. (I am German as well). This makes your life really easier... If uploading via the backend, Zenphoto has a tool to "correct" these. Problem with "umlaut" in photo filenames - Opunte - 2012-05-22 My name has a "umlaut" in it... Since Zenphoto is able to create thumbnails from photos, it can actually read them. Only some functions have problems. Problem with "umlaut" in photo filenames - acrylian - 2012-05-22 My name as well... Still it makes a lot of things easier as this encoding stuff is a really complicated part... Problem with "umlaut" in photo filenames - sbillard - 2012-05-22 Be sure your site character set is set to UTF-8. If it is then I do not have any ideas on this. The actual failure is trying to html encode a string (presumably conatining the umlaut diacritical.) The error message is saying that the character is not coded correctly for UTF-8 which is the internal character set of Zenphoto. Problem with "umlaut" in photo filenames - Opunte - 2012-05-23 UTF-8 is set as site character set. What I just noticed: from another client the image URL works. Both are Firefox, but maybe it's something with language selection? I'll do some more tests. Problem with "umlaut" in photo filenames - sbillard - 2012-05-23 There is a third possibility, but unusual, that the URI will need to be in UTF-8. There is an option for that as well. Problem with "umlaut" in photo filenames - Opunte - 2012-05-24
I just switched to protected images and those links work. So this is ok. But this still doesn't:
I've seen that some URLs are generated from the template-functions.php, so I'll try changing those first... Problem with "umlaut" in photo filenames - acrylian - 2012-05-24 Note that videos and especially video players may have their own issues with umlauts. We have no hand in those as they are third party. You should of course never modify core files. Problem with "umlaut" in photo filenames - Opunte - 2012-05-24
Problem with "umlaut" in photo filenames - acrylian - 2012-05-24 [i]Why not? If I can merge my changes with new releases?[/i] Problem with "umlaut" in photo filenames - Opunte - 2012-05-25 Ok, I understand. Sooo, back to the preview image of videos. I've searched my way from zp-core/zp-extensions/class-video.php, to zp-core/functions.php to zp-core/functions-basic.php and found safe_glob() where I changed line 1445 from return $glob; which fixed the problem for videothumbnails with umlauts. I've tested this with 4 files in an album: Before changing the multimedia file "video mit ö.mp4" was shown with the standard thumbnail mp4Default.png, after changig I got the correct thumbnail "video mit ö.jpg". Bad news: the change breaks various things in the admin backend (plugin listings, plugin options, ...) Suggestion: maybe image files need another globbing treatment like backend files which also takes care of the character-set that was configured via setup.php? Problem with "umlaut" in photo filenames - sbillard - 2012-05-25 This change will certainly break other parts of Zenphoto. Generally speaking zenphoto will convert file names to and from the filesystem character set as needed. Perhaps there is some place that is not being done, but it is not to be done in the general glob function. If you know the calling sequence leading up to this function then perhaps we can tell where something is missing. Problem with "umlaut" in photo filenames - Opunte - 2012-05-26 I traced it like this: zp-core/zp-extensions/class-video.php, line 82: checkObjectsThumb is in zp-core/functions.php and is called with the multimedia filenames. On line 202 safe_glob is called with the filenames, which is in zp-core/functions-basic.php. Add an "echo $file;" in functions-basic.php after line 1434 and you see that "readdir" gets the filenames with a different charset not UTF8. My browser cannot display them and shows a "?". So the problem is that safe_glob does not return the filenames with umlauts in it. They are not returned to checkObjectsThumb. So for those files class-video.php asumes the default image. I hope this is what you meant with "calling sequence" Problem with "umlaut" in photo filenames - sbillard - 2012-05-26 Thanks for your efforts. Actually, safe_glob returns file names as stored in the file system, which it should. Zenphoto should be converting them as needed by the useage. Seems that this was not happening correctly for these "stand-in" thumbnails. There is a correction for this in the nightly build of Zenphoto 1.4.3 Beta. If you can we would appreciate your testing the fix. Problem with "umlaut" in photo filenames - Opunte - 2012-05-29 I'll test the Beta and report back here. Problem with "umlaut" in photo filenames - Opunte - 2012-05-30 Tried it with version 1.4.3-BETA[10213]. Strange thing is: sometimes it works, sometimes not. In addition, there is a httpd referrer error, when trying to view any full sized image in protected mode: Problem with "umlaut" in photo filenames - sbillard - 2012-05-30 Please make a trouble ticket for this. Try to put as much information as possible in the description. For instance what the links are when the image shows and what they are when it fails. Any other thing that seems relevant. Not at all sure what might be the issue with that second error message. certainlyh index.php must normally be findable or nothing would work. |