Tim Burton is the second film director to tackle Roald Dahl's classic tale Charlie and the Chocolate Factory.

But Dahl's hatred of the original 1971 movie almost ended the new project before it began.

Dahl wrote the story of Charlie Bucket's trip to the fantastic factory of sweet inventor Willy Wonka in 1964, inspired by Dahl's brief schoolboy experience as a chocolate taster.

Filled with Everlasting Gobstoppers, Snozberries and Oompa Loompas, the colourful and mischievous tale would go on to sell 13.7 million copies in 32 languages.

Chocolate bar

By 1971 Hollywood also wanted a taste of Wonka's delicious chocolate.

The Quaker Oats Company financed the original $3m (£1.7m) movie to promote its new Wonka chocolate bar.

Directed by Mel Stuart, Dahl himself wrote the first screenplay but that did not prevent the film being re-named Willy Wonka and the Chocolate Factory.

The movie was a modest box office success, finishing 54th in the chart for that year, and Quaker's chocolate bar failed to grab the public imagination.

The 1971 movie was no blockbuster but it became a cult hit on TV

Nevertheless the film became a huge television hit in the 1980s - as regular a part of Christmas schedules as The Wizard of Oz or Chitty Chitty Bang Bang - with its surreal twists adding cult appeal.

Its enduring popularity owed much to its star, Gene Wilder, who made his entrance as Willy Wonka by pretending to be a frail old man before tumbling into manic action.

"I knew that from then on the audience wouldn't know if I was lying or telling the truth," Wilder said earlier this year.

Nevertheless his playful performance failed to win over Dahl, who remained convinced that his first choice - comedian Spike Milligan - would have been better for the role.

A cast of suitably bratty children, Oscar-nominated songs by Anthony Newley and a disturbing, psychedelic boat ride sequence did not prevent Dahl feeling "disappointed" in the movie.

Dahl lost faith in Hollywood's ability to do justice to his stories

"He thought it placed too much emphasis on Willy Wonka and not enough on Charlie," said Liz Attenborough, trustee of the Roald Dahl Museum and Story Centre in Buckinghamshire. "For him the book was about Charlie."

While that may have irritated the author, the film's deviations from the original Chocolate Factory plot infuriated him.

Re-worked by The Omen writer David Seltzer, the movie turned sweetshop rival Slugworth into a Wonka spy and encouraged Charlie and Grandpa Joe to belch their way to salvation.

His second wife, Felicity Dahl, understood the author's frustration. "They always want to change a book's storyline," she said in 1996.

"What makes Hollywood think children want the endings changed for a film, when they accept it in a book?"

'Utterly appalling'

Subsequent movie versions of Dahl books - such as Matilda, The BFG, Danny the Champion of the World and The Witches - brought a similarly hostile response, the author dismissing the latter film as "utterly appalling".

Feeling that another brush with Hollywood would bring one creative clash too many, Dahl refused to entertain the idea of a second Charlie and the Chocolate Factory film.

After Dahl's death in 1990, Felicity Dahl became the protector of his literary legacy. Six years later she began the process of vetting directors, actors and screenplays for a new Chocolate Factory movie.

Jim Carrey and Adam Sandler were among the actors considered for the Willy Wonka role, while Bruce Almighty director Tom Shadyac was suggested as film-maker.

Tim Burton said that his adaptation would be dark and sinister

It was finally decided that Tim Burton would direct Johnny Depp in the new $150m (£86m) movie, a partnership that had proved fruitful in 1990's Edward Scissorhands and 1999's Sleepy Hollow.

Burton soon declared this his version would be darker than the 1971 movie.

"I don't want to crush people's childhood dreams, but the original film is sappy," Burton said.

"I responded to the children's book because it respected that children can be adult, and I think adults forget that."

As he began to create a 192,000-gallon chocolate lake to engulf character Augustus Gloop, and training 40 squirrels to pounce upon Veruca Salt, Burton said the new film would feature "a sort of foreboding".