imagecreatefromjpeg
imagecreatefromjpeg is a PHP function in the GD graphics library that creates an image resource from a JPEG file. It loads a JPEG image into memory so PHP can manipulate it with the GD functions.
Syntax: resource imagecreatefromjpeg(string $filename)
Parameters: filename is the path to the JPEG file to load. The function may also load a
Return value: On success, it returns an image resource that can be used with other GD functions
Requirements and notes: The GD extension with JPEG support must be installed and enabled. The script must
Usage example: $img = imagecreatefromjpeg('uploads/photo.jpg'); if ($img === false) { die('Invalid JPEG'); } $width = imagesx($img); $height = imagesy($img); // perform processing
See also: imagejpeg, imagecreatefrompng, imagecreatefromstring, imagedestroy.