First thing popping up to me from this website.
https://www.giraffeworlds.com/giraffe-predators/.
Yes, you are right that the lion is the main predator of the giraffe.
You are also right that they mainly target them when there is no other prey or when they are young and weak.
However, this still doesn't mean that the leopard is not a predator of the giraffe, as quoted in the article:
"Leopards, hyenas, and wild dogs are other predatory carnivores that are a serious threat to giraffes, especially for newborns or very young who do not have the height, size, strength and experience needed to defend themselves. Lions and leopards usually choke their prey by the throat and crocodiles perform their “twist of death” to kill them almost instantaneously, but hyenas and wild dogs usually begin to eat before the giraffe is dead."
They do "especially" target newborns or very young giraffes, but they are a "serious threat" to giraffes in general.