Imagejpeg blurs flash text

I’m just using this simple script to take data sent from flash to this script to create a jpeg. The images look alright but the text is very blurry. However, when I set it from jpeg to png it looks fine. It’s at the highest quality too. Any suggestions please?

Also, I’m creating the image from a loaded swf with a child textfield set to readability.


<?php

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

    $im = imagecreatefromstring ($GLOBALS["HTTP_RAW_POST_DATA"]);
    
    header('Content-Type: image/jpeg');
    header("Content-Disposition: attachment; filename=".$_GET['name'].".jpg");
    imagejpeg($im, null, 100);
    imagedestroy($im); 
    
}  else echo 'An error occured.';

?>