

For example if you want to allow users to generate a 50x50 profile thumbnail on every crop then use target width and height. Target Width and Height are optional and can be used to force images to a specific size. For example allow a user to crop an uploaded image to a profile thumbnail.
#SIMPLEIMAGE PHP GITHUB FULL#
This can be used with JavaScript or App cropping libraries to allow users to generate thumbnails from a full uploaded image. Returns: $this crop($left, $top, $width, $height, $target_width = null, $target_height = null) If only width or only height are specified then image will be sized to that value. When both width and height are specified the image will be sized to the smaller of the two values so it fits. Resize an image to a specified max width and height. Returns: $this resize($max_width = null, $max_height = null) Opening a image requires PHP 5.4 or greater. If the file contains an invalid image then an E_WARNING error will be triggered causing an ErrorException to be thrown when using the default error setup. Image type is determined by the file extension. Open a image file (jpg, png, gif, or webp).
#SIMPLEIMAGE PHP GITHUB FREE#
This happens automatically when the variable is no longer used.Ĭlass Constructor - Optionally open an image _destruct()Ĭlass Destructor - Free memory by closing image when done. Optionally close the image to free memory when finished working with it. a path or save to a new file by specifying a full file path. Overwrite an existing image by simply calling without $img->pngCompression(6) // Default Compression-Level And Compression-Level (0 to 9) can be specified when saving PNG files. Save Quality (0 to 100) can be specified when saving JPG or WEBP images. the mobile device or a user may simply want to change the rotation. images because images can often upload with incorrect rotation depending on Images can be rotated which is useful for sites that allow users to upload $img->crop($left, $top, $width, $height, $target_width, $target_height) a user to crop an uploaded image to a profile thumbnail. to generate thumbnails from a full uploaded image. This can be used with JavaScript or App cropping libraries to allow users Images can also be cropped to a specific dimension.

specified then image will be sized proportionally to the value. When both width and height are specified the image will be sized to the Generate a Thumbnail or Resize the Image to a specified max width and height. file extension doesn't match the file type then an exception will be thrown. رمز المثال Open and Edit Images Files // Use the Media Image Class to open an image.
#SIMPLEIMAGE PHP GITHUB CODE#
It is intended to provide needed core functionally when working with image file uploads and for thumbnail generation.įor additional PHP image libraries see the following projects: Source Code This class provides basic functionally and is not full featured with filters or advanced features. Allow an image file to be opened, manipulated, and saved.
