png_hide 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

PngHide #

Overview #

A Dart library to hide text in PNG images. The procedure for encoding is the following:

  1. The input gets encoded into Base64 format

  2. The encoded input gets compressed, using the LZW algorithm

  3. The resuting bytes are hidden in the source-image, 1 Byte / Pixel

Samples #

Encode text into a copy of input.png and save it to output.png #

String text = "hallo ich bin ein text";

File input = File("assets/input.png");
File output = File("assets/output.png");

PngEncoder encoder = PngEncoder(input, output);
encoder.encode(text);

0.0.2 #

  • Added docstrings.
  • Added example.

0.0.1 #

  • Initial version

example/example.dart

import 'dart:io';
import 'package:png_hide/png_encoder.dart';

void encodeSample() {
  File input = File("assets/input.png");

  // output file ... does NOT have to exist yet
  File output = File("assets/output.png");

  PngEncoder pngEncoder = PngEncoder(input, output);

  String text = "When the war of the beasts brings about the world's end, The goddess descends from the sky Wings of light and dark spread afar She guides us to bliss, her gift everlasting.";

  //encode the String into the source image
  pngEncoder.encode(text);
}

void decodeSample() {
  File input = File("assets/input.png");

  // output file ... does NOT have to exist yet
  File output = File("assets/output.png");

  PngEncoder pngEncoder = PngEncoder(input, output);

  //get the text back from the output image
  String text = pngEncoder.decode();

  //outputs: "When the war of the beasts brings about the world's end, The goddess descends from the sky Wings of light and dark spread afar She guides us to bliss, her gift everlasting."
  print(text);
}

void main() {
  encodeSample();
  decodeSample();
}

Use this package as a library

1. Depend on it

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


dependencies:
  png_hide: ^0.0.2

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:png_hide/bit_data.dart';
import 'package:png_hide/illegal_state_exception.dart';
import 'package:png_hide/lzw.dart';
import 'package:png_hide/png_encoder.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io.

Health suggestions

Fix lib/lzw.dart. (-1.49 points)

Analysis of lib/lzw.dart reported 3 hints:

line 72 col 15: Unnecessary new keyword.

line 212 col 13: Unnecessary new keyword.

line 221 col 15: Unnecessary new keyword.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
image ^2.1.4 2.1.9
Transitive dependencies
archive 2.0.11
args 1.5.2
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
meta 1.1.8
path 1.6.4
petitparser 2.4.0
typed_data 1.1.6
xml 3.5.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0