passport_image 0.0.2 copy "passport_image: ^0.0.2" to clipboard
passport_image: ^0.0.2 copied to clipboard

A test package to generate passport size image. It takes an image and returns a passport size image.

This is a test package to resize photos to passport size, use at your own risk.

Features #

resize photos to passport size

Getting started #

if using image files they first need to be decoded using Image package for example

Usage #

Check main.dart in example folder

 void main() {
  // Load an image from file
  final inputFile = File('example/input.jpg');
  final inputImage = img.decodeImage(inputFile.readAsBytesSync());

  if (inputImage != null) {
    // Crop the image to passport size
    final croppedImage = ImageResize.resizeToPassportSize(inputImage);

    // Save the cropped image to a new file
    final outputFile = File('example/output_passport.jpg');
    outputFile.writeAsBytesSync(img.encodeJpg(croppedImage));
    print('Image successfully cropped to passport size.');
  } else {
    print('Failed to load the input image.');
  }
}

2
likes
160
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

A test package to generate passport size image. It takes an image and returns a passport size image.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, image

More

Packages that depend on passport_image