A federal court has ruled against a Texas law that would require voters to present photo IDs to election officials before being allowed to cast ballots in November.