Pakete, Repositories und App-Kategorien suchen

GitHub-Repositoryalann-maulana/image_compression

image_compression

Eine Dart-Erweiterung für das image-Paket zum Komprimieren und Ändern der Größe von Bildern.

Projektcover von image_compression
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}');
}
Alann Maulana GitHub avatar
GitHub-Autor

Alann Maulana ↗

Tenaga Kanggo Indonesia, PTTangerang
SprachenDart

Verwendete Abhängigkeiten

Abhängigkeiten 5 Einträge

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. 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 ↗