image_compression
Eine Dart-Erweiterung für das image-Paket zum Komprimieren und Ändern der Größe von Bildern.
- Sterne
- 11
- Forks
- 11
- Letzter Push (UTC)
- 15.02.2024
- Projektstatus
- Aktiv
Original-README
Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.
Image Compression
A Dart Extension for image package to compress and resize the images.
If you want to build for Flutter, use image_compression_flutter package. It support native compression and WEBP format conversion (Android & iOS only).
Sync Compression
import 'dart:io';
import 'package:image_compression/image_compression.dart';
void main() {
final file = File('/path/to/image/file.jpg');
final input = ImageFile(
rawBytes: file.readAsBytesSync(),
filePath: file.path,
);
final output = compress(ImageFileConfiguration(input: input));
print('Input size = ${file.lengthSync()}');
print('Output size = ${output.sizeInBytes}');
}
Async Compression
import 'dart:io';
import 'package:image_compression/image_compression.dart';
void main() {
final file = File('/path/to/image/file.jpg');
final input = ImageFile(
rawBytes: file.readAsBytesSync(),
filePath: file.path,
);
final output = await compressInQueue(ImageFileConfiguration(input: input));
print('Input size = ${file.lengthSync()}');
print('Output size = ${output.sizeInBytes}');
}
SprachenDart
Verwendete Abhängigkeiten
Wie wähle ich ein passendes Repository?
Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.
- Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
- Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
- Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.
Quellen und Pflege
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
- alann-maulana/image_compression · GitHub ↗
- GitHub Docs — Saving repositories with stars ↗
- Verzeichnis gepflegt von Ducafecat ↗