Saturday 30 April 2016

imagecreatefromjpeg PHP GD Function

Create a new image from a url or uploaded by file control

syntax:

resource imagecreatefromjpeg ( string $filename )

Argument Detail:

filename Path to the JPEG image.

Return Values :

imagecreatetruecolor PHP GD Function

The imagecreatetruecolor () function is used in PHP to create a new true color image using the GD Library.

resource imagecreatetruecolor ( int $width , int $height )

width
Image width for creating

height
Image height for creating

getimagesize PHP Function

Get the size of an image

array getimagesize ( string $filename [, array &$imageinfo ] )

The getimagesize() function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondent HTTP content type.

list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
echo $width;
echo $height;

Thursday 28 April 2016

Difference between Terminal and Non-Terminal Symbols (Compiler Design)


Terminal Symbol

  • A terminal is a symbol which does not appear on the left-hand side of any production.
  • Terminal symbols cannot be changed using the rules of the grammar.
  • terminal symbols, which are the characters of the alphabet that appear in the strings generated by the grammar.
  • a terminal symbol is one that cannot be broken down further, e.g. a literal character or digit (but not necessarily as it depends on the grammar).
example : Contant etc