dart_image_01 1.0.3

#dart_image - Image and graphics library for server side applications.

The image library aims to provide server-side programs the ability to load, manipulate, and save various image file formats.

Simple usage example to load a jpeg, resize it, and save it as a jpeg.

import 'dart:io' as Io;
import 'package:dart_image/dart_image.dart';
main() {
  Io.File file = new Io.File('res/cat-eye04.jpg');
  file.openSync();
  var bytes = file.readAsBytesSync();
  if (bytes == null) {
    return;
  }

  var jpegDecode = new JpegDecoder();
  var image = jpegDecode.decode(bytes);

  var thumbnail = image.resized(image.width ~/ 2, image.height ~/ 2);

  var jpegEncode = new JpegEncoder(100);
  var jpeg = jpegEncode.encode(thumbnail);

  Io.File fp = new Io.File('res/thumbnail-cat-eye04.jpg');
  fp.createSync(recursive: true);
  fp.writeAsBytesSync(jpeg);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_image_01: ^1.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_image_01/dart_image_01.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
54
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Jan 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/jpeg_encoder.dart. (-14.82 points)

Analysis of lib/src/jpeg_encoder.dart reported 32 hints, including:

line 3 col 1: Prefer using /// for doc comments.

line 36 col 23: Unnecessary new keyword.

line 61 col 13: The value of the local variable 'start' isn't used.

line 119 col 18: Unnecessary new keyword.

line 120 col 19: Unnecessary new keyword.

Fix lib/src/jpeg/_jpeg_data.dart. (-8.63 points)

Analysis of lib/src/jpeg/_jpeg_data.dart reported 18 hints, including:

line 9 col 29: Unnecessary new keyword.

line 17 col 10: Unnecessary new keyword.

line 55 col 27: Unnecessary new keyword.

line 272 col 8: The declaration '_skipBlock' isn't referenced.

line 286 col 12: Unnecessary new keyword.

Fix lib/src/png_decoder.dart. (-5.84 points)

Analysis of lib/src/png_decoder.dart reported 12 hints, including:

line 3 col 1: Prefer using /// for doc comments.

line 14 col 25: Unnecessary new keyword.

line 17 col 15: The value of the local variable 'palette' isn't used.

line 23 col 12: The value of the local variable 'colorSpace' isn't used.

line 27 col 24: Avoid const keyword.

Fix additional 12 files with analysis or formatting issues. (-20.74 points)

Additional issues in the following files:

  • lib/src/image.dart (11 hints)
  • lib/src/png_encoder.dart (8 hints)
  • lib/src/jpeg/_jpeg_frame.dart (4 hints)
  • lib/src/tga_encoder.dart (4 hints)
  • lib/dart_image_01.dart (3 hints)
  • lib/src/decoder.dart (3 hints)
  • lib/src/jpeg_decoder.dart (3 hints)
  • lib/src/jpeg/_jpeg.dart (2 hints)
  • lib/src/_byte_buffer.dart (1 hint)
  • lib/src/color.dart (1 hint)
  • lib/src/encoder.dart (1 hint)
  • lib/src/jpeg/_jpeg_scan.dart (1 hint)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field http://bitbucket.org/brendan_duncan/dart_image was unreachable.

Package is getting outdated. (-5.75 points)

The package was last published 55 weeks ago.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and dart_image_01.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
benchmark_harness ^1.0.5 1.0.5