DreamWorks Animation SKG Inc. had a wider net loss than anticipated in the second quarter, but beat analyst expectations for revenue.

The Glendale animation studio posted a net loss of $38.6 million (-45 cents a share) for the quarter ended June 30, compared with a net loss of $16 million (-18 cents) in the same period a year earlier. Revenue increased 40 percent to $171 million.

Analysts on average expected a net loss of -26 cents on revenue of $167 million, according to Thomson Financial Network.

Adjusted financials that exclude a $20.9 million pre-tax charge connected with a restructuring plan from early in the year put the net loss at $11.6 million, or -13 cents a share.

In January, the company announced a restructuring that saw top executives leave, a reduction in the number of feature films to be released, the closing of an animation studio in Redwood City, the laying off of about 500 employees and the sale of the Glendale campus.

DreamWorks Animation Chief Executive Jeffrey Katzenberg credited the studio’s sole feature film “Home” and television and new media businesses with providing solid results.

“The appetite for premium content across platforms continues to grow both domestically and internationally, and it’s clear DreamWorks Animation is well-positioned to capitalize on the growing demand,” Katzenberg said in a prepared statement.

“Home,” released at the end of March, has brought in $386 million in global box office receipts and was a rare bright spot for the studio. Two of three releases from last year, “Mr. Peabody and Sherman” and “Penguins of Madagascar” lost money requiring DreamWorks to take a write down on both.

The feature film business brought in $87.8 million in the second quarter, an increase of 26 percent from the $69.7 million from a year ago.

Revenue from the television business was $54.5 million in the second quarter compared with $20 million in the same period a year earlier. The increase was attributed to a higher number of episodes aired under licensing arrangements. DreamWorks currently has seven series on Nickelodeon and Netflix and will debut another seven by the end of the year.

Shares closed up 18 cents, or less than 1 percent, to $23.99 on the Nasdaq.