@dnax/core 0.9.6 → 0.9.7

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.
Files changed (2) hide show
  1. package/app/hono.ts +4 -1
  2. package/package.json +1 -1
package/app/hono.ts CHANGED
@@ -564,6 +564,7 @@ function HonoInstance(): typeof app {
564
564
  const width = parseInt(c.req.query("w")) || null;
565
565
  const height = parseInt(c.req.query("h")) || null;
566
566
  const quality = parseInt(c.req.query("q")) || 80;
567
+ const crop = c.req.query("fit") || "contain";
567
568
  // Vérifier si le fichier existe
568
569
  if (!fs.existsSync(filePath)) {
569
570
  return c.text("file not found", 404);
@@ -583,7 +584,9 @@ function HonoInstance(): typeof app {
583
584
  try {
584
585
  // Redimensionner l'image avec Sharp
585
586
  const buffer = await sharp(filePath)
586
- .resize(width, height)
587
+ .resize(width, height, {
588
+ fit: crop || "contain",
589
+ })
587
590
  .jpeg({ quality })
588
591
  .toBuffer();
589
592
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {