Relative Content

Tag Archive for phpimagebinarypnggd

Resize image held in variable while preserving aspect ratio using PHP

There are tons of answers here in SO and elsewhere on the web about how to resize an image using PHP when the image is on disk. However, these do not work if the image is held in a variable. I believe this is because the images on disk are binary files whereas the images in a variable are held as strings but I don’t know how to convert one to another.