We found when using phpthumbof, if we did not specify the output format it would default to png, which was generating some large image files. For example we had a 100kb jpeg that was coming out as a 1mb png. When I switched the output format to jpeg it became a 26kb file. So I updated the script to attempt to get the extension from the filename and if it matches jpeg,jpg,gif,png,bmp use the respective output format.
I'm unsure if there's a reason behind setting png as the default type, the only thing I could think of was to account for transparent images, so I went with jpeg as the default if the extension cannot be pulled from the filename, or if it does not match jpeg, jpg, gif, png or bmp.
We found when using phpthumbof, if we did not specify the output format it would default to png, which was generating some large image files. For example we had a 100kb jpeg that was coming out as a 1mb png. When I switched the output format to jpeg it became a 26kb file. So I updated the script to attempt to get the extension from the filename and if it matches jpeg,jpg,gif,png,bmp use the respective output format.
I'm unsure if there's a reason behind setting png as the default type, the only thing I could think of was to account for transparent images, so I went with jpeg as the default if the extension cannot be pulled from the filename, or if it does not match jpeg, jpg, gif, png or bmp.