embed static method
Implementation
static Uint8List embed(Uint8List imageBytes, Uint8List data) {
if (data.length < 8 || !_matchesMagic(data, 0, _magic)) {
throw ArgumentError('INVALID_PAYLOAD');
}
final jpegBytes = toJpegQ80(imageBytes);
if (jpegBytes == null) {
throw ArgumentError('INVALID_PNG');
}
final result = _native.robust2Embed(jpegBytes, data);
if (result == null) {
throw StateError('CAPACITY_EXCEEDED');
}
return result;
}