anchor.diff:  uses
     Classes, SysUtils, KM_Points, KM_CommonTypes
     {$IFDEF WDC OR FPC_FULLVERSION >= 30200}, KM_WorkerThread{$ENDIF};
  +
  +  // Delphi 11 Alexandria had bug with S.CopyFrom for TCompressionStream.
  +  // Bug occurs only during debugging, but its quite annoying
  +  // It was said this bug will be fixed in Delphi 11.1
  +  //
  +  // Related links:
  +  // https://quality.embarcadero.com/projects/RSP/issues/RSP-35516?filter=allopenissues
  +  // https://forum.fast-report.com/en/discussion/17186/tfrxpdfexport-ezcompressionerror-with-message-invalid-zstream-operation-in-delphi-11-2021-3
  +  // https://stackoverflow.com/questions/70242669/error-invalid-zstream-operation-delphi-11-0
  +  {$IFDEF VER350}{$IFDEF DEBUG} {$DEFINE NO_COMPRESSION} {$ENDIF}{$ENDIF}
   
   
   type
  
positive.code: procedure TKMemoryStream.SaveToFileCompressed(const aFileName: string; const aMarker: string);
  var
    S: TKMemoryStream;
    CS: TCompressionStream;
  begin
    S := TKMemoryStreamBinary.Create;
    try
      S.PlaceMarker(aMarker);
  
      CS := TCompressionStream.Create(GetCompressionLvl, S);
      try
        CS.CopyFrom(Self, 0);
      finally
        CS.Free;
      end;
  
      S.SaveToFile(aFileName);
    finally
  
negative.code: procedure TKMemoryStream.LoadFromFileCompressed(const aFileName: string; const aMarker: string);
  var
    S: TKMemoryStream;
    {$IFNDEF NO_COMPRESSION}
    DS: TDecompressionStream;
    {$ENDIF}
  begin
    S := TKMemoryStreamBinary.Create;
    try
      S.LoadFromFile(aFileName);
      S.CheckMarker(aMarker);
      {$IFDEF NO_COMPRESSION}
      CopyFrom(S, S.Size - S.Position);
      {$ELSE}
      DS := TDecompressionStream.Create(S);
      try
        CopyFromDecompression(DS);
      finally
        DS.Free;
      end;
      {$ENDIF}
      Position := 0;
    finally
      S.Free;
    end;
  