@runnerpro/backend 1.12.23 → 1.12.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -326,7 +326,8 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
326
326
  }
327
327
  });
328
328
  const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0, void 0, function* () {
329
- const size = '640x480';
329
+ const targetWidth = 500;
330
+ const targetHeight = 400;
330
331
  const quality = 2;
331
332
  const tempDir = path_1.default.join('./uploads');
332
333
  const outputFilename = `thumbnail_${Date.now()}.png`;
@@ -339,9 +340,16 @@ const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0,
339
340
  timestamps: [timestamp],
340
341
  filename: outputFilename,
341
342
  folder: tempDir,
342
- size,
343
- quality,
343
+ size: `${targetWidth}x${targetHeight}`,
344
+ // Agregar filtro para mantener aspect ratio y hacer crop (equivalente a object-fit: cover)
345
+ fastSeek: true,
344
346
  })
347
+ .videoFilters([
348
+ // Escalar manteniendo aspect ratio para que la dimensión menor coincida con el target
349
+ `scale=${targetWidth}:${targetHeight}:force_original_aspect_ratio=increase`,
350
+ // Hacer crop desde el centro para obtener exactamente el tamaño deseado
351
+ `crop=${targetWidth}:${targetHeight}`,
352
+ ])
345
353
  .on('end', () => {
346
354
  try {
347
355
  // Leer el archivo como buffer
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AA6aF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAqbF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.12.23",
3
+ "version": "1.12.24",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"