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]
8
Health:
Code health derived from static analysis. [more]
86
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Jul 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:dart_image_01/dart_image_01.dart with components: io.

Health suggestions

Fix lib/src/image.dart. (-2.96 points)

Analysis of lib/src/image.dart reported 6 hints, including:

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

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

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

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

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

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

Analysis of lib/src/jpeg_encoder.dart reported 5 hints:

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

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

line 560 col 26: Avoid types as parameter names.

line 560 col 32: Avoid types as parameter names.

line 598 col 50: DO use curly braces for all flow control structures.

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

Analysis of lib/src/png_decoder.dart reported 4 hints:

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

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 165 col 11: The value of the local variable 'crc' isn't used.

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

Additional issues in the following files:

  • lib/dart_image_01.dart (3 hints)
  • lib/src/png_encoder.dart (3 hints)
  • lib/src/decoder.dart (2 hints)
  • lib/src/tga_encoder.dart (2 hints)
  • lib/src/color.dart (1 hint)
  • lib/src/jpeg/_jpeg_data.dart (1 hint)
  • lib/src/jpeg/_jpeg_scan.dart (1 hint)
  • lib/src/jpeg_decoder.dart (1 hint)
  • lib/src/_byte_buffer.dart (Run dartfmt to format lib/src/_byte_buffer.dart.)
  • lib/src/encoder.dart (Run dartfmt to format lib/src/encoder.dart.)
  • lib/src/jpeg/_jpeg.dart (Run dartfmt to format lib/src/jpeg/_jpeg.dart.)
  • lib/src/jpeg/_jpeg_frame.dart (Run dartfmt to format lib/src/jpeg/_jpeg_frame.dart.)

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.

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

Admin