[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-image-editor.php (summary)

Base WordPress Image Editor

File Size: 552 lines (14 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 14 functions

  __construct()
  test()
  supports_mime_type()
  get_size()
  update_size()
  get_quality()
  set_quality()
  get_output_format()
  generate_filename()
  get_suffix()
  maybe_exif_rotate()
  make_image()
  get_mime_type()
  get_extension()

Functions
Functions that are not part of a class:

__construct( $file )   X-Ref
Each instance handles a single file.

param: string $file Path to the file to load.

test( $args = array()   X-Ref
Checks to see if current environment supports the editor chosen.
Must be overridden in a sub-class.

since: 3.5.0
return: bool
param: array $args

supports_mime_type( $mime_type )   X-Ref
Checks to see if editor supports the mime-type specified.
Must be overridden in a sub-class.

since: 3.5.0
return: bool
param: string $mime_type

get_size()   X-Ref
Gets dimensions of image.

since: 3.5.0
return: array {'width'=>int, 'height'=>int}

update_size( $width = null, $height = null )   X-Ref
Sets current image size.

since: 3.5.0
return: true
param: int $width
param: int $height

get_quality()   X-Ref
Gets the Image Compression quality on a 1-100% scale.

since: 4.0.0
return: int $quality Compression Quality. Range: [1,100]

set_quality( $quality = null )   X-Ref
Sets Image Compression quality on a 1-100% scale.

since: 3.5.0
return: true|WP_Error True if set successfully; WP_Error on failure.
param: int $quality Compression Quality. Range: [1,100]

get_output_format( $filename = null, $mime_type = null )   X-Ref
Returns preferred mime-type and extension based on provided
file's extension and mime, or current file's extension and mime.

Will default to $this->default_mime_type if requested is not supported.

Provides corrected filename only if filename is provided.

since: 3.5.0
return: array { filename|null, extension, mime-type }
param: string $filename
param: string $mime_type

generate_filename( $suffix = null, $dest_path = null, $extension = null )   X-Ref
Builds an output filename based on current file, and adding proper suffix

since: 3.5.0
return: string filename
param: string $suffix
param: string $dest_path
param: string $extension

get_suffix()   X-Ref
Builds and returns proper suffix for file based on height and width.

since: 3.5.0
return: false|string suffix

maybe_exif_rotate()   X-Ref
Check if a JPEG image has EXIF Orientation tag and rotate it if needed.

since: 5.3.0
return: bool|WP_Error True if the image was rotated. False if not rotated (no EXIF data or the image doesn't need to be rotated).

make_image( $filename, $function, $arguments )   X-Ref
Either calls editor's save function or handles file as a stream.

since: 3.5.0
return: bool
param: string|stream $filename
param: callable $function
param: array $arguments

get_mime_type( $extension = null )   X-Ref
Returns first matched mime-type from extension,
as mapped from wp_get_mime_types()

since: 3.5.0
return: string|false
param: string $extension

get_extension( $mime_type = null )   X-Ref
Returns first matched extension from Mime-type,
as mapped from wp_get_mime_types()

since: 3.5.0
return: string|false
param: string $mime_type



Generated: Sun Sep 22 01:00:03 2019 Cross-referenced by PHPXref 0.7.1