But they almost certainly didn't say straightforwardly, 'OP, you're ugly.' It will have come out in little indirect, possibly unconscious ways, like 'well-meant' advice, or comparing you to someone etc.
A friend of mine, with no malicious intent, once sent me a photo she'd come across somewhere of a woman falling out of a club, blind drunk, and said it reminded her of me. It was a terrible photo. The woman's face was distorted from drink, red and blotchy, her hair a mess, and she was extremely overweight and crammed into a dress far too small for her. I remember sitting on my bed (we were postgrad students) and thinking 'That's what I look like to X'? I did actually pick her up on it. I texted her and said 'Would you be happy if I'd sent you a similar photo saying you looked like this?' And she was horrified she'd hurt my feelings, and said she'd thought I'd find it funny, but the fact remained that this photo had made her think of me, and it was horrible to think that this image had resembled me in her eyes.
I knew perfectly well I was a plumpish, averagely plain twentysomething, but I'd thought (hoped?) that careful self-presentation, make-up, clothes etc meant I just about got by as 'average' or 'slightly below average, but wouldn't stand out'.