This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:image/image.dart' as img; | |
| Future<File> addWatermarkToImage(File originalImage, String text) async { | |
| final originalBytes = await originalImage.readAsBytes(); | |
| final image = img.decodeImage(originalBytes); | |
| // Asegúrate de que la imagen se decodificó correctamente | |
| if (image == null) { | |
| throw Exception('No se pudo decodificar la imagen'); | |
| } |