I currently use phpthumb to generate thumbnails for profile pictures. http://phpthumb.gxdlabs.com/
This is my current method:
<?php
$path_to_profile_pic = '../icons/default.png';
$profile_pic = file_get_contents('icons/default.png');
$small_profile_pic = PhpThumbFactory::create($profile_pic, array(), true);
$small_profile_pic->adaptiveResize(25, 25);
$small_profile_picAsString = $small_profile_pic->getImageAsString();
?>
<img src="data:image/png;base64,<?php echo base64_encode($small_profile_picAsString); ?>" width="25" height="25" />
However, this is very slow due to base64 because it generates a large number of text in your code. What is the best way to use phpthumb to generate thumbnails?
Edit
Is there a way to do it without saving another image since it would consume more space?