native_exif icon indicating copy to clipboard operation
native_exif copied to clipboard

Can't inject modified exif data width and height in a memory image

Open houssam15 opened this issue 8 months ago • 0 comments

      final originalExif = await Exif.fromPath(widget.file.path);
      dynamic originMetaDataAttributes = await originalExif.getAttributes();
      originMetaDataAttributes['PixelXDimension'] = controller.croppedImage?.width;
      originMetaDataAttributes['PixelYDimension'] = controller.croppedImage?.height;

      final tempPath = '${directory.path}/${DateTime.now().millisecondsSinceEpoch.toString()}_edited.${widget.extension}';
      await File(tempPath).writeAsBytes(imageBytes);
      final exif = await Exif.fromPath(tempPath);
      await exif.writeAttributes(originMetaDataAttributes);

error :

flutter: PlatformException(SRC_ERROR, Error while getting source type, null, null)

houssam15 avatar Apr 23 '25 11:04 houssam15