My understanding of this is that capital gains or ordinary income will be due even if the property is sold at basis.
So land inherited at 100 and sold for 220 with fair market of 250.
Sales price * Original Basis / FMV = Adjusted basis for gain
220 * 100/250 = 88
88 is the new basis in the property. 220 - 88 = 132 gain on the sale plus a 30 donation.
Property sold at basis with donation
100 * 100 / 250 = 40
40 is new basis in property. 100 - 40 = 60 gain and 150 donation
Donation requires professional appraisal for FMV. AGI limits apply.
Reg. 1.1011-2