@capgo/capacitor-file-compressor 8.1.9 → 8.1.11
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
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# @capgo/capacitor-file-compressor
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Compress and resize images on the device before upload, and convert between JPEG, PNG and WebP. Smaller files mean faster uploads and lower storage costs.
|
|
4
|
+
|
|
5
|
+
<a href="https://capgo.app/?ref=plugin_file-compressor"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-file-compressor" alt="Capgo - Instant updates for Capacitor" /></a>
|
|
3
6
|
|
|
4
7
|
<div align="center">
|
|
5
|
-
<
|
|
6
|
-
<h2><a href="https://capgo.app/
|
|
8
|
+
<p><b>Capgo</b>: open-source live updates for Ionic and Capacitor apps. Ship OTA fixes and features instantly, without waiting for app store review.</p>
|
|
9
|
+
<h2><a href="https://capgo.app/register/?ref=plugin_file-compressor">➡️ Get started for free</a></h2>
|
|
10
|
+
<p>14-day unlimited free trial. No credit card required</p>
|
|
11
|
+
<p><a href="https://capgo.app/consulting/?ref=plugin_file-compressor">Missing a feature? We'll build the plugin for you 💪</a></p>
|
|
7
12
|
</div>
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="https://raw.githubusercontent.com/Cap-go/capacitor-file-compressor/main/assets/github-social-preview.png" alt="@capgo/capacitor-file-compressor for Capacitor apps" width="300" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Key features
|
|
19
|
+
|
|
20
|
+
- **One call**: `compressImage()` resizes and compresses with your width, height and quality.
|
|
21
|
+
- **Format conversion**: output JPEG, PNG or WebP on Android and web. iOS adds HEIF or HEIC, and WebP needs iOS 14 or later.
|
|
22
|
+
- **Smart sizing**: keeps the aspect ratio and never upscales.
|
|
23
|
+
- **Best-effort size**: if the result is larger than the source, quality is lowered for lossy formats. PNG has no quality setting, so the output can still be larger.
|
|
24
|
+
- **Privacy**: EXIF metadata is removed during compression.
|
|
25
|
+
- **Platforms**: iOS, Android and Web. iOS uses ImageIO, Android uses `Bitmap`, web uses the canvas.
|
|
10
26
|
|
|
11
27
|
## Why File Compressor?
|
|
12
28
|
|
|
@@ -20,7 +20,7 @@ import java.util.UUID;
|
|
|
20
20
|
@CapacitorPlugin(name = "FileCompressor")
|
|
21
21
|
public class FileCompressorPlugin extends Plugin {
|
|
22
22
|
|
|
23
|
-
private final String pluginVersion = "8.1.
|
|
23
|
+
private final String pluginVersion = "8.1.11";
|
|
24
24
|
private static final float MIN_QUALITY = 0.1f;
|
|
25
25
|
private static final float QUALITY_STEP = 0.05f;
|
|
26
26
|
private static final List<String> SUPPORTED_OUTPUT_MIME_TYPES = Arrays.asList("image/jpeg", "image/png", "image/webp");
|
|
@@ -6,7 +6,7 @@ import UniformTypeIdentifiers
|
|
|
6
6
|
|
|
7
7
|
@objc(FileCompressorPlugin)
|
|
8
8
|
public class FileCompressorPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
9
|
-
private let pluginVersion: String = "8.1.
|
|
9
|
+
private let pluginVersion: String = "8.1.11"
|
|
10
10
|
private let minimumQuality: CGFloat = 0.1
|
|
11
11
|
private let qualityStep: CGFloat = 0.05
|
|
12
12
|
public let identifier = "FileCompressorPlugin"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-file-compressor",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.11",
|
|
4
4
|
"description": "Capacitor plugin for efficient image compression supporting PNG, JPEG, and WebP formats across iOS, Android, and Web platforms",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|