Skip to content

Latest commit

 

History

History
17 lines (10 loc) · 443 Bytes

how-to-save-jpg-image-to-file.md

File metadata and controls

17 lines (10 loc) · 443 Bytes

How to save JPG image to file

$im = imagecreatetruecolor(400, 300);

# ...

imagejpeg($im, '/tmp/image.jpg');
  • imagecreatetruecolor - creates true color lib:GD image object with specified width & height
  • imagejpeg - saves $im gd object to the specified 'jpeg' file
  • /tmp/image.jpg - path to save jpeg to

group: save_formats