ilp_file_codec 1.0.17

SDKdartflutter
Platformandroidioswindowslinuxmacos

.ilp file codec.

Image Layers Package(.ilp) file codec

Features

This package is the .ilp file codec.

Work flows

  1. Use the Photoshop plugin to export the config.json and some images files.
  2. Use ILP encoder encode the config.json to .ilp file.
  3. Use ILP decoder decode the .ilp file to data.

The .ilp file structure

PartRangeLengthBytes ContentGzipDesc
A0 ~ 34[0x49, 0x4c, 0x50, 0x21]Fixed file strings.
convert to utf8 is: ILP!
B4 ~ 74int32 valueProtobuf ILPHeader bytes length
C8 ~ 8+CPart B int valueProtobuf ILPHeader bytes✔Check out protobuf
D8+C+1 ~ dynamicdynamicProtobuf ILPInfo(List) bytes✔Check out protobuf
Edynamic ~ enddynamicProtobuf ILPLayer(List) bytes✔Check out protobuf

Usage

Check out the test/ilp_codec_test.dart file.

Exception Codes

EntityCodeContent
ILPilp_file_not_existsilp file not exists
ilp_file_parse_errordecoder can't parse the ilp file content
ILPInfoConfiginfo_file_not_existsinfo config file not exists
info_file_not_string_fileinfo config file not a string file
info_file_parse_errorinfo file content can not parse to json data
info_missing_widthmissing the width field
info_missing_heightmissing the height field
info_missing_covermissing the cover field
info_cover_not_existscover file not exists
info_missing_layersmissing the layers field
ILPLayerConfiglayer_no_filewhen get the layer group id will throw this exception
layer_missing_widthmissing the width field
layer_missing_heightmissing the height field
layer_missing_xmissing the x field
layer_missing_ymissing the y field
layer_missing_filemissing the file field
layer_file_not_existslayer file not exists

Before run the test

  • Requirement: Open test.psd and use the Photoshop plugin export the files to the test folder.

  • Optional: Run the command to generate protobuf dart side code:

    cd ./ilp_codec
    protoc -I .\protobuf --dart_out=.\lib\protobuf .\protobuf\*.proto
    

License