Take a look at this issue, it may point you in the right direction: https://github.com/Studio-42/elFinder/issues/671
PHP, getting Thumbnail for an image in Elfinder
-
24-06-2022 - |
質問
I use Elfinder 2.1 and i'm looking for a possibility to get the right thumbnail path of an image with PHP.
By default a .tmb folder exist in every folder and contains the resized thumbnails with an (i think) md5 hashed filename.
How can i retrieve the correct thumbnail for a specific image in PHP? The goal is to show only the thumbnails in another PHP Script and with a click the original imgage shows up.
解決 2
他のヒント
Thanks, was useful. I added one thing.
protected function tmbname($stat) {
$ext = 'png';
if($stat['mime'] == 'image/jpeg'){$ext = 'jpg';}
if($stat['mime'] == 'image/gif'){$ext = 'gif';}
return current(explode('.', $stat['name'])).'.'.$ext;
//$stat['hash'].$stat['ts'].'.png';
}
Works well and deletes too.
I answered that question just a few minutes ago on the above link. In short:
search for the function
tmbname($stat)
in the classelFinderVolumeDriver.class.php
replace the return value with this:
current(explode('.', $stat['name'])).'.png';
This way the created thumbnails will have the same name as the original image (of course with .png extension). If that will arise security questions/problems, I don't know. Hope it does help.