wp_image_matches_ratio


wp_image_matches_ratio ( $source_width, $source_height, $target_width, $target_height )

Parameters:
  • (int) $source_width Width of the first image in pixels.
  • (int) $source_height Height of the first image in pixels.
  • (int) $target_width Width of the second image in pixels.
  • (int) $target_height Height of the second image in pixels.
Returns:
  • (bool) True if aspect ratios match within 1px. False if not.
Defined at:

Description

Helper function to test if aspect ratios for two images match.

Related Functions

wp_media_attach_action, wp_get_attachment_caption, wp_image_editor, image_add_caption, wp_mime_type_icon

Top Google Results

User discussions

wpseek mobile