TORONTO -- A man who filmed up the skirt of a young woman at a fair and then swallowed the camera's memory card as police approached him has had his child pornography conviction overturned because officers violated his rights egregiously, Ontario's top court ruled on Wednesday.

In acquitting Daniel Adler, the Court of Appeal said it had no choice other than to exclude key evidence against him given the "blatant disregard" for his charter rights.

"In doing so, the court acquits a person who is clearly guilty of serious criminal offences," Justice Ian Nordheimer wrote. "This unpalatable result is a direct product of the manner in which the police chose to conduct themselves."

Adler was at the Canadian National Exhibition in Toronto in August 2016 when a woman told patrolling officers she had seen him doing an upskirt video using a camera hidden in the head of a stuffed owl. As police approached him, they saw him fumble with the head, place something in his mouth, and then swallow, according to court records.

The officers arrested him. They also confiscated several items, including the stuffed owl and digital devices, including a video camera that had no memory card.

For several hours, police did not let Adler speak to a lawyer. They did, however, strip search him and set up a "bedpan vigil." They also went inside his apartment that night without a warrant before withdrawing to await a tele-warrant. Officers then searched the apartment, finding parts of stuffed animals and an external computer hard drive.

The following day, the prosecution delayed his bail hearing for several days without telling the judge it was to see if he passed the memory card. He did, but the card was unreadable.

A search of items police had seized turned up evidence of child pornography. They also found a video of Adler having sexual contact with an unknown woman who appeared to be unconscious, leading to a sexual assault charge, court documents show.

Despite misgivings about the searches, Ontario court Judge Malcolm McLeod convicted Adler on July 20, 2018, of child pornography and sexual assault based entirely on the evidence found on the seized devices. He sentenced him to 3 1/2 years in prison.

In deciding the appeal, the higher court said the tele-warrant for his home should not have been issued because there was simply no urgency to the situation given that Adler was in detention. Nordheimer also found officers were misleading when they applied for their warrants.

The judge, he said, had been "much too quick" to excuse the police conduct that involved seven separate breaches of Adler's rights. Those included delaying his right to a lawyer, keeping an unauthorized vigil for him to eliminate the memory card, misleading the courts during bail hearings, and entering his home without a warrant.

"That litany of breaches is remarkable for a single arrest on a single event," Nordheimer said. "It reflects a sweeping ignorance by the police of the appellant's constitutional rights."

The overall result was that the police misconduct "tainted" all the evidence, leaving no option but to enter an acquittal, the justice said.

Adler had been allowed to remain on bail pending the outcome of his appeal due to the COVID-19 crisis.

This report by The Canadian Press was first published on April 8, 2020.