title: Compress jpeg on server with PHP
body: <p>I have a site with about 1500 JPEG images, and I want to compress them all. Going through the directories is not a problem, but I cannot seem to find a function that compresses a JPEG that is already on the server (I don't want to upload a new one), and replaces the old one.</p>
  
  <p>Does PHP have a built in function for this? If not, how do I read the JPEG from the folder into the script?</p>
  
  <p>Thanks.</p>