The past six months have been awfully dark for OmniVision Technologies (Nasdaq: OVTI) shareholders like fellow Fool Anders Bylund and me. After a strong multiyear run to all-time highs of $37.05 early last year, shares proceeded to crater with a vengeance over the summer and through the end of 2011. They reached as low as $10.15 in November, a gut-wrenching loss of 73% off the high.

The loss of the juicy Apple (Nasdaq: AAPL) iPhone 4S camera spot to rival Sony (NYSE: SNE) played no small part in the drop, feeding the bears and coaxing them out of hibernation. The guidance slashes didn't help much, either.

The image-sensor specialist just reported third-quarter earnings last night after the market close, with shares jumping by double digits after hours. How did the results stack up against what the market was expecting?

Just the numbers, please
Revenue in the third quarter was $185.2 million, an unhealthy decline of 30% from the prior year's $265.7 million, back when things were shining bright. Non-GAAP net income came out to just $7.4 million, or $0.13 per share, which shrinks when compared with the $0.84-per-share profit the company put up last time around.

The top line slid past the Street's expectations of $175 million in sales, while the bottom-line profit was right on target. Gross margin slid down to 24.2%, which was attributed to a reduction in average selling prices and moving inventory that carried a high cost basis.

OmniVision's cash position fell by $228.3 million sequentially, but a large chunk of this drop was related to repurchasing $100 million in stock, in line with its previously announced repurchase program. The company bought back 8.1 million shares during the quarter, helping to reduce shares outstanding to 52.3 million. This offset dilution from equity compensation to insiders over the past year and then some, as there were 56.8 million shares outstanding a year ago.

I'm a tad bit uneasy about the ballooning inventory balance, which has rocketed by 164% from $93.6 million a year ago to $247.3 million. Last quarter, the company had warned about an "unexpected cutback in customer orders," but its inventory has been high relative to historical levels for two quarters now. OmniVision needs to get through that inventory posthaste, lest it be written down.

The good news
The third-quarter figures weren't blockbusters, so what are investors so excited about? Guidance.

OmniVision is forecasting fourth-quarter sales in the range of $195 million to $215 million, which is a healthy head above the $170 million consensus estimate for the coming quarter. The bottom-line guidance is just as encouraging; non-GAAP earnings per share are expected to be in the ballpark of $0.15 to $0.28, also beating the dime that analysts were looking for.

A new hope
The implicit hope behind those strong digits is that OmniVision may be regaining Cupertino's favor, contrary to earlier reports. There are fears that Samsung may have won the iPad 3 primary camera spot, but we'll have to wait for confirmation there.

The company's second-generation BSI-2 sensors have just now started to hit the market, with an 8-megapixel BSI-2 shooter recently being found inside the Asus Transformer Prime tablet, whose camera has garnered impressive reviews. The iPad 3 is rumored to carry an 8-megapixel sensor, and winning that spot would be a major leap in the right direction for OmniVision.

iPad 3 production probably began months ago, so I would have expected more of a bump this quarter if OVT had indeed won that spot, especially since the company recognizes revenue to OEMs using the "sell-in" method (as opposed to the "sell-through" method it uses with distributors).

OVT has always been tight-lipped about its Apple relationship, so without additional clarity we're left guessing until the teardowns come in.

Party time?
After being dogged with so much pessimism for months, a bit of optimism is a welcome relief. Shares are up by almost half year to date as they recover from absurdly cheap levels (cheap enough to catch David Einhorn's attention).

It's still too early to proclaim party time for OmniVision in 2012, but at least now I can start formulating a guest list and shopping around for caterers. Formal invitations, however, will have to wait a few more quarters.

OmniVision's prospects as a mobile component supplier are starting to look up, but they remain far from certain. For more promising component plays, The Motley Fool has just released a new special free report that names 3 Hidden Winners of the iPhone, iPad, and Android Revolution. These three companies are set to rake in profits from the mobile revolution. Get your free copy now.