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_get_attachment_caption, wp_media_attach_action, wp_image_file_matches_image_meta, wp_image_editor, image_add_caption

Top Google Results

User discussions

wpseek mobile