[wp-trac] [WordPress Trac] #61514: Media attachments REST API endpoint: Fix cropping on one axis only

WordPress Trac noreply at wordpress.org
Thu Jun 27 03:01:56 UTC 2024


#61514: Media attachments REST API endpoint: Fix cropping on one axis only
--------------------------+--------------------
 Reporter:  andrewserong  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.6
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+--------------------
 As discussed in #59782, a fix for casting values as int in the attachments
 REST API endpoint revealed a bug in the endpoint for image cropping where
 if requesting a crop on only one axis, the crop would fail to take effect.

 A proposed solution is to update the logic in the endpoint so that a crop
 is valid if at least one dimension of the target image size is different
 from the source image size, rather than requiring both dimensions to be
 different.

 To reproduce the issue, see the reproduction steps in
 https://github.com/WordPress/gutenberg/issues/62855 — in the block editor,
 in 6.6 RC 1, cropping the image block fails because the block editor uses
 an aspect-ratio based crop where one dimension is always the same as the
 source image.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61514>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list