@dnax/core 0.15.5 → 0.15.6
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.
- package/app/hono.ts +2 -3
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -503,9 +503,8 @@ function HonoInstance(): typeof app {
|
|
|
503
503
|
|
|
504
504
|
// Obtenir le type MIME du fichier
|
|
505
505
|
const mimeType = mime.lookup(filePath);
|
|
506
|
-
|
|
507
506
|
// Si ce n'est pas une image, retourner le fichier original
|
|
508
|
-
if (!mimeType || !mimeType
|
|
507
|
+
if (!mimeType || !mimeType?.startsWith("image/")) {
|
|
509
508
|
const originalFile = fs.readFileSync(filePath);
|
|
510
509
|
return c.body(originalFile, 200, {
|
|
511
510
|
"Content-Type": mimeType || "application/octet-stream",
|
|
@@ -518,7 +517,7 @@ function HonoInstance(): typeof app {
|
|
|
518
517
|
.resize(width, height, {
|
|
519
518
|
fit: crop || "contain",
|
|
520
519
|
})
|
|
521
|
-
.
|
|
520
|
+
.png({ quality })
|
|
522
521
|
.toBuffer();
|
|
523
522
|
|
|
524
523
|
// Retourner l'image redimensionnée
|