@uploadista/flow-images-photon 0.0.12 → 0.0.13-beta.3
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/README.md +46 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -48,6 +48,52 @@ export default {
|
|
|
48
48
|
- ✅ **Auto-Scaling**: Handles any traffic
|
|
49
49
|
- ✅ **Multiple Formats**: Automatic optimization
|
|
50
50
|
|
|
51
|
+
## Transformation Support
|
|
52
|
+
|
|
53
|
+
### Supported vs Unsupported Transformations
|
|
54
|
+
|
|
55
|
+
Photon supports most common image transformations but has limitations compared to Sharp. Use this matrix to determine which plugin to use for your workflow:
|
|
56
|
+
|
|
57
|
+
| Transformation | Photon Support | Sharp Support | Notes |
|
|
58
|
+
|---------------|----------------|---------------|-------|
|
|
59
|
+
| **Basic Transformations** |
|
|
60
|
+
| Resize | ✅ Full | ✅ Full | Both support width, height, fit modes |
|
|
61
|
+
| Blur | ✅ Full | ✅ Full | Gaussian blur with sigma parameter |
|
|
62
|
+
| Rotate | ❌ Not supported | ✅ Full | Use Sharp for rotation |
|
|
63
|
+
| Flip | ✅ Full | ✅ Full | Horizontal and vertical flip |
|
|
64
|
+
| **Filter Transformations** |
|
|
65
|
+
| Grayscale | ✅ Full | ✅ Full | Convert to grayscale |
|
|
66
|
+
| Sepia | ✅ Full | ✅ Full | Apply sepia tone |
|
|
67
|
+
| Brightness | ✅ Full | ✅ Full | Adjust brightness (-100 to +100) |
|
|
68
|
+
| Contrast | ✅ Full | ✅ Full | Adjust contrast (-100 to +100) |
|
|
69
|
+
| **Effect Transformations** |
|
|
70
|
+
| Sharpen | ✅ Full | ✅ Full | Image sharpening |
|
|
71
|
+
| **Advanced Transformations** |
|
|
72
|
+
| Watermark | ❌ Not supported | ✅ Full | Use Sharp for watermarks |
|
|
73
|
+
| Logo overlay | ❌ Not supported | ✅ Full | Use Sharp for logo overlays |
|
|
74
|
+
| Text overlay | ❌ Not supported | ✅ Full | Use Sharp for text rendering |
|
|
75
|
+
|
|
76
|
+
### Unsupported Transformations
|
|
77
|
+
|
|
78
|
+
When using the `transform` method with unsupported transformation types, Photon will return a clear error:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// This will fail with Photon plugin
|
|
82
|
+
const result = await imagePlugin.transform(imageBytes, {
|
|
83
|
+
type: 'watermark',
|
|
84
|
+
imagePath: '/watermark.png',
|
|
85
|
+
position: 'bottom-right',
|
|
86
|
+
opacity: 0.5
|
|
87
|
+
});
|
|
88
|
+
// Error: "Photon plugin does not support 'watermark'. Use sharp plugin or remove this transformation."
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Recommendation
|
|
92
|
+
|
|
93
|
+
- **Use Photon when**: You need edge deployment, global performance, and only use basic transformations (resize, blur, flip, filters)
|
|
94
|
+
- **Use Sharp when**: You need advanced features (watermarks, logos, text, rotation) or running in Node.js environment
|
|
95
|
+
- **Hybrid approach**: Use both! Deploy Photon for fast basic operations at edge, and Sharp for advanced transformations in your origin server
|
|
96
|
+
|
|
51
97
|
## Node Types
|
|
52
98
|
|
|
53
99
|
### Resize (Edge)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/flow-images-photon",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13-beta.3",
|
|
5
5
|
"description": "Photon image processing service for Uploadista Flow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@cf-wasm/photon": "0.2.1",
|
|
24
|
-
"effect": "3.19.
|
|
24
|
+
"effect": "3.19.2",
|
|
25
25
|
"tinycolor2": "1.6.0",
|
|
26
26
|
"zod": "4.1.12",
|
|
27
|
-
"@uploadista/core": "0.0.
|
|
27
|
+
"@uploadista/core": "0.0.13-beta.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "24.10.0",
|
|
31
31
|
"@types/tinycolor2": "1.4.6",
|
|
32
32
|
"tsdown": "0.16.0",
|
|
33
|
-
"@uploadista/typescript-config": "0.0.
|
|
33
|
+
"@uploadista/typescript-config": "0.0.13-beta.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsdown",
|