Flash Player 9 Unacceptable JPEG’s from phpThumb

Using phpThumb at work. You upload a video file, and the server generates a thumbnail from the video via phpThumb. Here’s the bad news: The thumbnail doesn’t work in IE6 and IE7 on Windows in Flash Player 9. Everything else works (Firefox, Windows Safari (sometimes), Opera, and everything works on Mac). Flash Player 8 works, but AS1/AS2 Flash Player 9 (compiled by Flash CS3) does not.

So, something changed in Flash Player 9 that affects the JPEG rendering because the JPEG’s work fine in everything else. It’s only a big deal because the biggest feature of Flash Player is backwards compatibility; aka, Flash Player 1 content should work as intended in Flash Player 9. Naturally everyone and their mom will blame phpThumb doing something different with headers, etc. “Enterprise company with a 10 year-old rendering engine vs. an open source image generator… um… yeah.”

As soon as we get our code pushed to production, I’ll make a few test cases for the Adobe engineers, but in the meantime, anyone else experienced this? If so, and you are reading this blog from a Google search, hopefully we’ve posted a solution in the comments, hehe. As of today, the server guys got it working somehow (aka modifying phpThumb’s base code, something about headers :: shrugs ::). Really really frikin’ hard to test with caching, etc. so it’s been long and bloody.

7 Replies to “Flash Player 9 Unacceptable JPEG’s from phpThumb”

  1. I’ve used phpThumb a bit, but not by using the phpThumb.php script. You can just use phpThumb as a regular class, and implement your own headers and caching as well. Not so much to debug then!

  2. Glad to see you got it working.
    Regarding the caching, if you are using AS3, try setting the shouldCacheResponse and useCache properties of the URLRequest class. Additionally, for any version of AS, you can append a query string with a random ID to the image request.
    e.g.
    var randomID:String = String(Math.random());
    var request:URLRequest = new URLRequest(“image.jpg”+randomID );

  3. update to that bit of code. Should read:
    var request:URLRequest = new URLRequest(”image.jpg?id=”+randomID );

  4. I’m already using the random number trick for the image loading. It’s the server guys who have it rough in testing, not me.

  5. You can get phpThumb working with flash quite easily – this is from the phpThumb FAQ.. ( http://phpthumb.sourceforge.net/demo/docs/phpthumb.faq.txt )

    “Q: Why can’t Flash work with images output from phpThumb()?
    A: Flash doesn’t like progressive JPEG. Set:
    $PHPTHUMB_CONFIG[‘output_interlace’] = false;”

    Worked a treate for me, once I cleared out the phpthumb/cache directory on my server..

    Good luck!

  6. Yes, you’re right – sorry. I went back and looked at the tweaking I’d done on phpThumb and noticed that I’d also set it to generate PNG’s as thumbs instead of JPG’s. That was the tweak that got it up and running for me, and not the interlacing option..

    Regardless, it’s working for me anyway. My only gripe now is that it’s godawfully slow in generating the initial thumbnails.. Once it’s cached then there’s no problem. I’ve had to get my uploading scripts to display the thumbs directly after uploading.. Not a massive problem at all, more of a “crap, another thing I didn’t want to have to spend my time messing about with”.

    Have a good Christmas!

Comments are closed.