bugs
This commit is contained in:
@@ -115,9 +115,10 @@ class GameObjectsManager{
|
||||
* @param {File} thumbSrc A thumbnail, представително изображение
|
||||
*/
|
||||
this.addThumb = async function(object, thumbSrc){
|
||||
let ext = path.extname(object.asset.ofn).toLowerCase();
|
||||
let ext = path.extname(thumbSrc).toLowerCase();
|
||||
console.log(object, thumbSrc, ext);
|
||||
let dest = `${config.fs.repo}/thumb/${object.id}.webp`;
|
||||
if (['.jpg', '.png', '.webp'].includes(ext)){
|
||||
if (['.jpg', '.png', '.webp'].includes(ext) || !ext){
|
||||
await sharp(thumbSrc).resize({height: 250}).toFile(dest);
|
||||
}else if (['.mp4', '.avi', '.webv'].includes(ext)){
|
||||
let frame = 1;
|
||||
|
||||
Reference in New Issue
Block a user