elFinder サムネイルの大きさを変えたりクロップをオフにする方法
この記事には広告を含む場合があり、記事内で紹介する商品を購入すると当サイトに売り上げの一部が還元されることがあります。
例えば以下のようなものはアフィリエイト収入を得ています。
- 広告リンクテキスト・広告バナー
- 商品リンク(一部紹介リンクじゃないものもありますが基本的に紹介リンクだと思っていただいたほうが安心です。)
- リンクテキストや画像リンクをコピーして、アドレス欄に貼り付けた時に「https://px.a8.net/」や「https://ck.jp.ap.valuecommerce.com/」、などASPのURLが含まれるリンク
- リンクに「affiliate」などのアフィリエイトリンク
など。
また、企業様より報酬を受け取っての記事の場合は、記事の冒頭に「マーケティング主体の名称」と「関係性の内容」、「PR」や「提供」を明記しておりますので安心してご覧いただけます。
問題のある表現がありましたら、お問い合わせまでご連絡ください。
elFinderは、デフォルト設定のままだと、サムネイルのアイコンが48pxと物凄く小さくて画質が粗く、更に勝手にクロップしてしまい、なんの写真なのかとても分かりづらい状態になってしまいます。
解決方法としては、phpフォルダの中にある「connector.minimal.php」の「$opts」の配列にtmbSizeやtmbCropなどサムネイル関連の設定項目を追加します。
サムネイルのサイズを240くらいにすれば見やすくなるかと思います。すでにサムネイルが生成されている場合は、サムネイルを削除することをで再生成され高画質になります。
▼参考
例:
$opts = array(
// 'debug' => true,
'roots' => array(
// Items volume
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../files/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
'tmbSize' => '240',
'tmbCrop' => false,
'trashHash' => 't1_Lw', // elFinder's hash of trash folder
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
// 'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain'), // Mimetype `image` and `text/plain` allowed to upload
'uploadAllow' => array('all'),// Same as above
'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
),
// Trash volume
array(
'id' => '1',
'driver' => 'Trash',
'path' => '../files/.trash/',
'tmbURL' => dirname($_SERVER['PHP_SELF']) . '/../files/.trash/.tmb/',
'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
'uploadDeny' => array('all'), // Recomend the same settings as the original volume that uses the trash
// 'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain'), // Same as above
'uploadAllow' => array('all'),// Same as above
'uploadOrder' => array('deny', 'allow'), // Same as above
'accessControl' => 'access', // Same as above
),
)
);