[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Base WordPress Image Editor

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

Defines 15 functions

  __construct()
  test()
  supports_mime_type()
  get_size()
  update_size()
  get_quality()
  set_quality()
  get_default_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 subclass.

param: array $args
return: bool
since: 3.5.0

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

param: string $mime_type
return: bool
since: 3.5.0

get_size()   X-Ref
Gets dimensions of image.

return: int[] {
since: 3.5.0

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

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

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

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

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

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

get_default_quality( $mime_type )   X-Ref
Returns the default compression quality setting for the mime type.

param: string $mime_type
return: int The default quality setting for the mime type.
since: 5.8.1

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.

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

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

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

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

return: string|false suffix
since: 3.5.0

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

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).
since: 5.3.0

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

param: string   $filename
param: callable $callback
param: array    $arguments
return: bool
since: 3.5.0

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

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

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

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



Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1