Version
1.5.0
Platforms
iOS
Device Model
iPhone 12 Pro Max
flutter info
Flutter version i am using 3.19.6
How to reproduce?
var rootMergeContainer = ImageMergeOption(
canvasSize: Size(exportWidth.toDouble(), exportHeight.toDouble()),
format: OutputFormat.jpeg(80),
);
ByteData exportBackgroundData;
exportBackgroundData = await rootBundle.load(
"assets/drawable/photobook_layouts/ic_photobook_text_white_bg.jpg");
Uint8List exportBG = exportBackgroundData.buffer.asUint8List();
rootMergeContainer.addImage(MergeImageConfig(
image: MemoryImageSource(exportBG),
position:
ImagePosition(Offset(0, 0), Size(2400, 2400))));
Uint8List centerCropSrcUInt8List;
rootMergeContainer.addImage(MergeImageConfig(
image: MemoryImageSource(exportBG),
position: ImagePosition(
Offset(100,
200),
2200,
2200))));
Uint8List? result = await ImageMerger.mergeToMemory(
option: rootMergeContainer,
);
MemoryImage? provider = MemoryImage(result!);
Uint8List originalBytes = provider.bytes;
Uint8List resultBytes = Uint8List.fromList(originalBytes);
resultBytes[13] = 1;
resultBytes[14] = (300 >> 8);
resultBytes[15] = (300 & 0xff);
resultBytes[16] = (300 >> 8);
resultBytes[17] = (300 & 0xff);
String tempPath = await Utilities.getAppDirectoryPath(
isPlatformAndroid: Platform.isAndroid,
isPlatformIOS: Platform.isIOS);
File? file;
if (Platform.isAndroid) {
String imgName = "IMG_AND_COLOR_TILES_" +
DateTime.now().millisecondsSinceEpoch.toString() +
JPEG_EXTENSION;
print(imgName);
file = File('$tempPath/$imgName');
} else if (Platform.isIOS) {
String imgName = "IMG_IOS_COLOR_TILES_" +
DateTime.now().millisecondsSinceEpoch.toString() +
JPEG_EXTENSION;
print(imgName);
file = File('$tempPath/$imgName');
}
file?.writeAsBytesSync(resultBytes.bytes);

Logs
No response
Example code (optional)
No response
Contact
No response