Unless Gallinari can guard 3s reasonably well, this might not be a great on-court fit. In a pure asset value sense, Danilo is worth more than any individual asset given up and if he plays up to his best and is more durable than he has been recently, he will be worth a lot more.
They could've done a better job of negotiating the contract though.