"I Am Number Four" star Alex Pettyfer's ex-GF split with him over a risque photo shoot he did with two half-naked models -- but here's the rub ... the shoot occurred MONTHS before they even started dating.
Sources close to the ex-couple tell TMZ, "Glee" star Dianna Agron ended the relationship soon after the pictures were released a couple weeks ago ... in which Alex appears barely clothed with models Lydia Hearst and Leven Rambin.
Problem is -- Alex and Dianna started dating last August ... and he shot the pics over a year ago ... back when he was a single man. Dianna's rep wouldn't comment on the story.
Kids these days.